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)
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)
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)))
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)))