コード例 #1
0
ファイル: test_special.py プロジェクト: wjjmjh/cogent3
 def test_one_minus_exp_small(self):
     """one_minus_exp_x should return -x if x is small"""
     self.assertFloatEqual(one_minus_exp(1e-30), -1e-30)
コード例 #2
0
 def test_one_minus_exp_small(self):
     """one_minus_exp_x should return -x if x is small"""
     assert_allclose(one_minus_exp(1e-30), -1e-30)
コード例 #3
0
ファイル: test_special.py プロジェクト: wjjmjh/cogent3
 def test_one_minus_exp_large(self):
     """one_minus_exp_x should return 1 - math.exp(x) if x is large"""
     self.assertFloatEqual(one_minus_exp(0.2), 1 - (math.exp(0.2)))
コード例 #4
0
 def test_one_minus_exp_large(self):
     """one_minus_exp_x should return 1 - math.exp(x) if x is large"""
     assert_allclose(one_minus_exp(0.2), 1 - (math.exp(0.2)))