def test_float_less_than_double(): # This tests, that float has less precision than double: assert abs(float_arg(1.12, 0.183, 3.14) - 0.183) < eps_single assert abs(float_arg(1.12, 0.183, 3.14) - 0.183) > eps_double
def test_float(): assert abs(float_arg(1.12, 2, 3.14) - 2) < eps_single assert abs(float_arg(1.12, 2., 3.14) - 2) < eps_single assert abs(float_arg(1.12, 2.1, 3.14) - 2.1) < eps_single assert abs(float_arg(1.12, 0.183, 3.14) - 0.183) < eps_single