コード例 #1
0
ファイル: test_math.py プロジェクト: AdamPrzybyla/python-cf
 def testSinh(self):
     self.assertRaises(TypeError, math.sinh)
     self.ftest('sinh(0)', math.sinh(0), 0)
     self.ftest('sinh(1)**2-cosh(1)**2', math.sinh(1)**2-math.cosh(1)**2, -1)
     self.ftest('sinh(1)+sinh(-1)', math.sinh(1)+math.sinh(-1), 0)
     self.assertEqual(math.sinh(INF), INF)
     self.assertEqual(math.sinh(NINF), NINF)
     self.assertTrue(math.isnan(math.sinh(NAN)))
コード例 #2
0
ファイル: test_math_new.py プロジェクト: wsbnauka/python-cf
 def testSinh(self):
     self.assertRaises(TypeError, math.sinh)
     self.ftest('sinh(0)', math.sinh(0), 0)
     self.ftest('sinh(1)**2-cosh(1)**2', math.sinh(1)**2-math.cosh(1)**2, -1)
     self.ftest('sinh(1)+sinh(-1)', math.sinh(1)+math.sinh(-1), 0)
     self.assertEqual(math.sinh(INF), INF)
     self.assertEqual(math.sinh(NINF), NINF)
     self.assertTrue(math.isnan(math.sinh(NAN)))
コード例 #3
0
ファイル: test_math.py プロジェクト: AdamPrzybyla/python-cf
 def testCosh(self):
     self.assertRaises(TypeError, math.cosh)
     self.ftest('cosh(0)', math.cosh(0), 1)
     self.ftest('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
     self.assertEqual(math.cosh(INF), INF)
     self.assertEqual(math.cosh(NINF), INF)
     self.assertTrue(math.isnan(math.cosh(NAN)))
コード例 #4
0
ファイル: test_math_new.py プロジェクト: wsbnauka/python-cf
 def testCosh(self):
     self.assertRaises(TypeError, math.cosh)
     self.ftest('cosh(0)', math.cosh(0), 1)
     self.ftest('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
     self.assertEqual(math.cosh(INF), INF)
     self.assertEqual(math.cosh(NINF), INF)
     self.assertTrue(math.isnan(math.cosh(NAN)))