Use proper floating point literals.

signbit() and friends should always take floating point arguments. This
fixes a compiler error when using FreeBSD's own <math.h>.
This commit is contained in:
Ed Schouten 2015-01-09 14:09:57 +01:00
parent 410e6ebb59
commit 8429b82a93

View file

@ -2741,7 +2741,7 @@ fpclassify_test (void)
check_int ("fpclassify (-inf) == FP_INFINITE", fpclassify (minus_infty), FP_INFINITE, 0, 0, 0);
check_int ("fpclassify (+0) == FP_ZERO", fpclassify (plus_zero), FP_ZERO, 0, 0, 0);
check_int ("fpclassify (-0) == FP_ZERO", fpclassify (minus_zero), FP_ZERO, 0, 0, 0);
check_int ("fpclassify (1000) == FP_NORMAL", fpclassify (1000), FP_NORMAL, 0, 0, 0);
check_int ("fpclassify (1000) == FP_NORMAL", fpclassify (1000.0), FP_NORMAL, 0, 0, 0);
print_max_error ("fpclassify", 0, 0);
}
@ -2886,9 +2886,9 @@ isfinite_test (void)
{
init_max_error ();
check_bool ("isfinite (0) == true", isfinite (0), 1, 0, 0, 0);
check_bool ("isfinite (0) == true", isfinite (0.0), 1, 0, 0, 0);
check_bool ("isfinite (-0) == true", isfinite (minus_zero), 1, 0, 0, 0);
check_bool ("isfinite (10) == true", isfinite (10), 1, 0, 0, 0);
check_bool ("isfinite (10) == true", isfinite (10.0), 1, 0, 0, 0);
check_bool ("isfinite (inf) == false", isfinite (plus_infty), 0, 0, 0, 0);
check_bool ("isfinite (-inf) == false", isfinite (minus_infty), 0, 0, 0, 0);
check_bool ("isfinite (NaN) == false", isfinite (nan_value), 0, 0, 0, 0);
@ -2901,9 +2901,9 @@ isnormal_test (void)
{
init_max_error ();
check_bool ("isnormal (0) == false", isnormal (0), 0, 0, 0, 0);
check_bool ("isnormal (0) == false", isnormal (0.0), 0, 0, 0, 0);
check_bool ("isnormal (-0) == false", isnormal (minus_zero), 0, 0, 0, 0);
check_bool ("isnormal (10) == true", isnormal (10), 1, 0, 0, 0);
check_bool ("isnormal (10) == true", isnormal (10.0), 1, 0, 0, 0);
check_bool ("isnormal (inf) == false", isnormal (plus_infty), 0, 0, 0, 0);
check_bool ("isnormal (-inf) == false", isnormal (minus_infty), 0, 0, 0, 0);
check_bool ("isnormal (NaN) == false", isnormal (nan_value), 0, 0, 0, 0);
@ -3908,15 +3908,15 @@ signbit_test (void)
init_max_error ();
check_bool ("signbit (0) == false", signbit (0), 0, 0, 0, 0);
check_bool ("signbit (0) == false", signbit (0.0), 0, 0, 0, 0);
check_bool ("signbit (-0) == true", signbit (minus_zero), 1, 0, 0, 0);
check_bool ("signbit (inf) == false", signbit (plus_infty), 0, 0, 0, 0);
check_bool ("signbit (-inf) == true", signbit (minus_infty), 1, 0, 0, 0);
/* signbit (x) != 0 for x < 0. */
check_bool ("signbit (-1) == true", signbit (-1), 1, 0, 0, 0);
check_bool ("signbit (-1) == true", signbit (-1.0), 1, 0, 0, 0);
/* signbit (x) == 0 for x >= 0. */
check_bool ("signbit (1) == false", signbit (1), 0, 0, 0, 0);
check_bool ("signbit (1) == false", signbit (1.0), 0, 0, 0, 0);
print_max_error ("signbit", 0, 0);
}