예제 #1
0
 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
 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)))