diff options
author | Joseph Myers <joseph@codesourcery.com> | 2013-05-16 13:19:38 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2013-05-16 13:19:38 +0000 |
commit | 105a07dfc0678d13556126e04b9548f87f7f5d95 (patch) | |
tree | 7876603298e31bd3e6272d98dd372841e0757afa /math/libm-test.inc | |
parent | e9eee333b9157d13734ddb459b6edf1afca20603 (diff) | |
download | glibc-105a07dfc0678d13556126e04b9548f87f7f5d95.tar.gz glibc-105a07dfc0678d13556126e04b9548f87f7f5d95.tar.xz glibc-105a07dfc0678d13556126e04b9548f87f7f5d95.zip |
Support testing "inexact" exceptions in libm-test.inc.
Diffstat (limited to 'math/libm-test.inc')
-rw-r--r-- | math/libm-test.inc | 791 |
1 files changed, 399 insertions, 392 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index c8fe08e113..7e3fc3b970 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -82,10 +82,6 @@ against. These implemented tests should check all cases that are specified in ISO C99. - Exception testing: At the moment only divide-by-zero, invalid, - overflow and underflow exceptions are tested. Inexact exceptions - aren't checked at the moment. - NaN values: There exist signalling and quiet NaNs. This implementation only uses quiet NaN as parameter. Where the sign of a NaN is significant, this is not tested. The payload of NaNs is not examined. @@ -155,18 +151,22 @@ #define DIVIDE_BY_ZERO_EXCEPTION 0x2 #define OVERFLOW_EXCEPTION 0x4 #define UNDERFLOW_EXCEPTION 0x8 +#define INEXACT_EXCEPTION 0x10 /* The next flags signals that those exceptions are allowed but not required. */ -#define INVALID_EXCEPTION_OK 0x10 -#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x20 -#define OVERFLOW_EXCEPTION_OK 0x40 -#define UNDERFLOW_EXCEPTION_OK 0x80 +#define INVALID_EXCEPTION_OK 0x20 +#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x40 +#define OVERFLOW_EXCEPTION_OK 0x80 +#define UNDERFLOW_EXCEPTION_OK 0x100 +/* For "inexact" exceptions, the default is allowed but not required + unless INEXACT_EXCEPTION or NO_INEXACT_EXCEPTION is specified. */ +#define NO_INEXACT_EXCEPTION 0x200 #define EXCEPTIONS_OK INVALID_EXCEPTION_OK+DIVIDE_BY_ZERO_EXCEPTION_OK /* Some special test flags, passed together with exceptions. */ -#define IGNORE_ZERO_INF_SIGN 0x100 +#define IGNORE_ZERO_INF_SIGN 0x400 /* Indicate errno settings required or disallowed. */ -#define ERRNO_UNCHANGED 0x200 -#define ERRNO_EDOM 0x400 -#define ERRNO_ERANGE 0x800 +#define ERRNO_UNCHANGED 0x800 +#define ERRNO_EDOM 0x1000 +#define ERRNO_ERANGE 0x2000 /* Values underflowing only for float. */ #ifdef TEST_FLOAT @@ -551,6 +551,11 @@ test_exceptions (const char *test_name, int exception) test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION, FE_UNDERFLOW, "Underflow"); #endif +#ifdef FE_INEXACT + if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0) + test_single_exception (test_name, exception, INEXACT_EXCEPTION, + FE_INEXACT, "Inexact"); +#endif feclearexcept (FE_ALL_EXCEPT); } @@ -11734,48 +11739,48 @@ static const struct test_f_f_data nearbyint_test_data[] = { START_DATA (nearbyint), - TEST_f_f (nearbyint, 0.0, 0.0), - TEST_f_f (nearbyint, minus_zero, minus_zero), - TEST_f_f (nearbyint, plus_infty, plus_infty), - TEST_f_f (nearbyint, minus_infty, minus_infty), - TEST_f_f (nearbyint, qnan_value, qnan_value), + TEST_f_f (nearbyint, 0.0, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, minus_zero, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, plus_infty, plus_infty, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, minus_infty, minus_infty, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, qnan_value, qnan_value, NO_INEXACT_EXCEPTION), /* Subnormal values */ - TEST_f_f (nearbyint, -8.98847e+307, -8.98847e+307), - TEST_f_f (nearbyint, -4.45015e-308, minus_zero), + TEST_f_f (nearbyint, -8.98847e+307, -8.98847e+307, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -4.45015e-308, minus_zero, NO_INEXACT_EXCEPTION), /* Default rounding mode is round to nearest. */ - TEST_f_f (nearbyint, 0.5, 0.0), - TEST_f_f (nearbyint, 1.5, 2.0), - TEST_f_f (nearbyint, -0.5, minus_zero), - TEST_f_f (nearbyint, -1.5, -2.0), - - TEST_f_f (nearbyint, 262144.75, 262145.0), - TEST_f_f (nearbyint, 262142.75, 262143.0), - TEST_f_f (nearbyint, 524286.75, 524287.0), - TEST_f_f (nearbyint, 524288.75, 524289.0), - - TEST_f_f (nearbyint, 1048576.75, 1048577.0), - TEST_f_f (nearbyint, 2097152.75, 2097153.0), - TEST_f_f (nearbyint, 2492472.75, 2492473.0), - TEST_f_f (nearbyint, 2886220.75, 2886221.0), - TEST_f_f (nearbyint, 3058792.75, 3058793.0), - TEST_f_f (nearbyint, -1048576.75, -1048577.0), - TEST_f_f (nearbyint, -2097152.75, -2097153.0), - TEST_f_f (nearbyint, -2492472.75, -2492473.0), - TEST_f_f (nearbyint, -2886220.75, -2886221.0), - TEST_f_f (nearbyint, -3058792.75, -3058793.0), -#ifndef TEST_FLOAT - TEST_f_f (nearbyint, 70368744177664.75, 70368744177665.0), - TEST_f_f (nearbyint, 140737488355328.75, 140737488355329.0), - TEST_f_f (nearbyint, 281474976710656.75, 281474976710657.0), - TEST_f_f (nearbyint, 562949953421312.75, 562949953421313.0), - TEST_f_f (nearbyint, 1125899906842624.75, 1125899906842625.0), - TEST_f_f (nearbyint, -70368744177664.75, -70368744177665.0), - TEST_f_f (nearbyint, -140737488355328.75, -140737488355329.0), - TEST_f_f (nearbyint, -281474976710656.75, -281474976710657.0), - TEST_f_f (nearbyint, -562949953421312.75, -562949953421313.0), - TEST_f_f (nearbyint, -1125899906842624.75, -1125899906842625.0), + TEST_f_f (nearbyint, 0.5, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 1.5, 2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -0.5, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -1.5, -2.0, NO_INEXACT_EXCEPTION), + + TEST_f_f (nearbyint, 262144.75, 262145.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 262142.75, 262143.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 524286.75, 524287.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 524288.75, 524289.0, NO_INEXACT_EXCEPTION), + + TEST_f_f (nearbyint, 1048576.75, 1048577.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 2097152.75, 2097153.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 2492472.75, 2492473.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 2886220.75, 2886221.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 3058792.75, 3058793.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -1048576.75, -1048577.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -2097152.75, -2097153.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -2492472.75, -2492473.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -2886220.75, -2886221.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -3058792.75, -3058793.0, NO_INEXACT_EXCEPTION), +#ifndef TEST_FLOAT + TEST_f_f (nearbyint, 70368744177664.75, 70368744177665.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 140737488355328.75, 140737488355329.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 281474976710656.75, 281474976710657.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 562949953421312.75, 562949953421313.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, 1125899906842624.75, 1125899906842625.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -70368744177664.75, -70368744177665.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -140737488355328.75, -140737488355329.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -281474976710656.75, -281474976710657.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -562949953421312.75, -562949953421313.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -1125899906842624.75, -1125899906842625.0, NO_INEXACT_EXCEPTION), #endif END_DATA (nearbyint) @@ -12821,117 +12826,119 @@ static const struct test_f_f_data rint_test_data[] = START_DATA (rint), /* TODO: missing qNaN tests. */ - TEST_f_f (rint, 0.0, 0.0), - TEST_f_f (rint, minus_zero, minus_zero), - TEST_f_f (rint, plus_infty, plus_infty), - TEST_f_f (rint, minus_infty, minus_infty), + TEST_f_f (rint, 0.0, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, minus_zero, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, plus_infty, plus_infty, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, minus_infty, minus_infty, NO_INEXACT_EXCEPTION), /* Default rounding mode is round to even. */ - TEST_f_f (rint, 0.5, 0.0), - TEST_f_f (rint, 1.5, 2.0), - TEST_f_f (rint, 2.5, 2.0), - TEST_f_f (rint, 3.5, 4.0), - TEST_f_f (rint, 4.5, 4.0), - TEST_f_f (rint, -0.5, -0.0), - TEST_f_f (rint, -1.5, -2.0), - TEST_f_f (rint, -2.5, -2.0), - TEST_f_f (rint, -3.5, -4.0), - TEST_f_f (rint, -4.5, -4.0), - TEST_f_f (rint, 0.1, 0.0), - TEST_f_f (rint, 0.25, 0.0), - TEST_f_f (rint, 0.625, 1.0), - TEST_f_f (rint, -0.1, -0.0), - TEST_f_f (rint, -0.25, -0.0), - TEST_f_f (rint, -0.625, -1.0), - TEST_f_f (rint, 262144.75, 262145.0), - TEST_f_f (rint, 262142.75, 262143.0), - TEST_f_f (rint, 524286.75, 524287.0), - TEST_f_f (rint, 524288.75, 524289.0), - TEST_f_f (rint, 1048576.75, 1048577.0), - TEST_f_f (rint, 2097152.75, 2097153.0), - TEST_f_f (rint, -1048576.75, -1048577.0), - TEST_f_f (rint, -2097152.75, -2097153.0), -#ifndef TEST_FLOAT - TEST_f_f (rint, 70368744177664.75, 70368744177665.0), - TEST_f_f (rint, 140737488355328.75, 140737488355329.0), - TEST_f_f (rint, 281474976710656.75, 281474976710657.0), - TEST_f_f (rint, 562949953421312.75, 562949953421313.0), - TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0), - TEST_f_f (rint, -70368744177664.75, -70368744177665.0), - TEST_f_f (rint, -140737488355328.75, -140737488355329.0), - TEST_f_f (rint, -281474976710656.75, -281474976710657.0), - TEST_f_f (rint, -562949953421312.75, -562949953421313.0), - TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0), + TEST_f_f (rint, 0.5, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1.5, 2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2.5, 2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 3.5, 4.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 4.5, 4.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.5, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1.5, -2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2.5, -2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -3.5, -4.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -4.5, -4.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.1, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.25, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.625, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.1, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.25, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.625, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 262144.75, 262145.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 262142.75, 262143.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 524286.75, 524287.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 524288.75, 524289.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1048576.75, 1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2097152.75, 2097153.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1048576.75, -1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2097152.75, -2097153.0, INEXACT_EXCEPTION), +#ifndef TEST_FLOAT + TEST_f_f (rint, 70368744177664.75, 70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 140737488355328.75, 140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 281474976710656.75, 281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 562949953421312.75, 562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -70368744177664.75, -70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -140737488355328.75, -140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -281474976710656.75, -281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -562949953421312.75, -562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0, INEXACT_EXCEPTION), #endif #ifdef TEST_LDOUBLE /* The result can only be represented in long double. */ - TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L), - TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L), + TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L), + TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L, INEXACT_EXCEPTION), # endif - TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L), - TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L), + TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L), - - TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L), - TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L), - - TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L), - TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L), + TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L, INEXACT_EXCEPTION), # endif - TEST_f_f (rint, 9007199254740991.5L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.25L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.5L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.75L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740993.5L, 9007199254740994.0L), - - TEST_f_f (rint, -9007199254740991.5L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.25L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.5L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.75L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740993.5L, -9007199254740994.0L), - - TEST_f_f (rint, 72057594037927935.5L, 72057594037927936.0L), - TEST_f_f (rint, 72057594037927936.25L, 72057594037927936.0L), - TEST_f_f (rint, 72057594037927936.5L, 72057594037927936.0L), - TEST_f_f (rint, 72057594037927936.75L, 72057594037927937.0L), - TEST_f_f (rint, 72057594037927937.5L, 72057594037927938.0L), - - TEST_f_f (rint, -72057594037927935.5L, -72057594037927936.0L), - TEST_f_f (rint, -72057594037927936.25L, -72057594037927936.0L), - TEST_f_f (rint, -72057594037927936.5L, -72057594037927936.0L), - TEST_f_f (rint, -72057594037927936.75L, -72057594037927937.0L), - TEST_f_f (rint, -72057594037927937.5L, -72057594037927938.0L), - - TEST_f_f (rint, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L), - TEST_f_f (rint, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L), - TEST_f_f (rint, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L), - TEST_f_f (rint, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L), - TEST_f_f (rint, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L), + TEST_f_f (rint, 9007199254740991.5L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.25L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.75L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5L, 9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.5L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.25L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.75L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5L, -9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 72057594037927935.5L, 72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927936.25L, 72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927936.5L, 72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927936.75L, 72057594037927937.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927937.5L, 72057594037927938.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -72057594037927935.5L, -72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927936.25L, -72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927936.5L, -72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927936.75L, -72057594037927937.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927937.5L, -72057594037927938.0L, INEXACT_EXCEPTION), + +# if LDBL_MANT_DIG > 100 + TEST_f_f (rint, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L, INEXACT_EXCEPTION), +# endif #endif END_DATA (rint) }; @@ -12947,73 +12954,73 @@ rint_test (void) static const struct test_f_f_data rint_tonearest_test_data[] = { START_DATA (rint_tonearest), - TEST_f_f (rint, 2.0, 2.0), - TEST_f_f (rint, 1.5, 2.0), - TEST_f_f (rint, 1.0, 1.0), - TEST_f_f (rint, 0.5, 0.0), - TEST_f_f (rint, 0.0, 0.0), - TEST_f_f (rint, minus_zero, minus_zero), - TEST_f_f (rint, -0.5, -0.0), - TEST_f_f (rint, -1.0, -1.0), - TEST_f_f (rint, -1.5, -2.0), - TEST_f_f (rint, -2.0, -2.0), - TEST_f_f (rint, 0.1, 0.0), - TEST_f_f (rint, 0.25, 0.0), - TEST_f_f (rint, 0.625, 1.0), - TEST_f_f (rint, -0.1, -0.0), - TEST_f_f (rint, -0.25, -0.0), - TEST_f_f (rint, -0.625, -1.0), - TEST_f_f (rint, 1048576.75, 1048577.0), - TEST_f_f (rint, 2097152.75, 2097153.0), - TEST_f_f (rint, -1048576.75, -1048577.0), - TEST_f_f (rint, -2097152.75, -2097153.0), -#ifndef TEST_FLOAT - TEST_f_f (rint, 70368744177664.75, 70368744177665.0), - TEST_f_f (rint, 140737488355328.75, 140737488355329.0), - TEST_f_f (rint, 281474976710656.75, 281474976710657.0), - TEST_f_f (rint, 562949953421312.75, 562949953421313.0), - TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0), - TEST_f_f (rint, -70368744177664.75, -70368744177665.0), - TEST_f_f (rint, -140737488355328.75, -140737488355329.0), - TEST_f_f (rint, -281474976710656.75, -281474976710657.0), - TEST_f_f (rint, -562949953421312.75, -562949953421313.0), - TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0), + TEST_f_f (rint, 2.0, 2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 1.5, 2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1.0, 1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.5, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.0, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, minus_zero, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -0.5, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1.0, -1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -1.5, -2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2.0, -2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.1, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.25, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.625, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.1, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.25, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.625, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1048576.75, 1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2097152.75, 2097153.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1048576.75, -1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2097152.75, -2097153.0, INEXACT_EXCEPTION), +#ifndef TEST_FLOAT + TEST_f_f (rint, 70368744177664.75, 70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 140737488355328.75, 140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 281474976710656.75, 281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 562949953421312.75, 562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -70368744177664.75, -70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -140737488355328.75, -140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -281474976710656.75, -281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -562949953421312.75, -562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0, INEXACT_EXCEPTION), #endif #ifdef TEST_LDOUBLE /* The result can only be represented in long double. */ - TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L), - TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L), + TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L), + TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L, INEXACT_EXCEPTION), # endif - TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L), - TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L), + TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L), - - TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L), - TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L), - - TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L), - TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L), + TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L, INEXACT_EXCEPTION), # endif #endif END_DATA (rint_tonearest) @@ -13030,73 +13037,73 @@ rint_test_tonearest (void) static const struct test_f_f_data rint_towardzero_test_data[] = { START_DATA (rint_towardzero), - TEST_f_f (rint, 2.0, 2.0), - TEST_f_f (rint, 1.5, 1.0), - TEST_f_f (rint, 1.0, 1.0), - TEST_f_f (rint, 0.5, 0.0), - TEST_f_f (rint, 0.0, 0.0), - TEST_f_f (rint, minus_zero, minus_zero), - TEST_f_f (rint, -0.5, -0.0), - TEST_f_f (rint, -1.0, -1.0), - TEST_f_f (rint, -1.5, -1.0), - TEST_f_f (rint, -2.0, -2.0), - TEST_f_f (rint, 0.1, 0.0), - TEST_f_f (rint, 0.25, 0.0), - TEST_f_f (rint, 0.625, 0.0), - TEST_f_f (rint, -0.1, -0.0), - TEST_f_f (rint, -0.25, -0.0), - TEST_f_f (rint, -0.625, -0.0), - TEST_f_f (rint, 1048576.75, 1048576.0), - TEST_f_f (rint, 2097152.75, 2097152.0), - TEST_f_f (rint, -1048576.75, -1048576.0), - TEST_f_f (rint, -2097152.75, -2097152.0), -#ifndef TEST_FLOAT - TEST_f_f (rint, 70368744177664.75, 70368744177664.0), - TEST_f_f (rint, 140737488355328.75, 140737488355328.0), - TEST_f_f (rint, 281474976710656.75, 281474976710656.0), - TEST_f_f (rint, 562949953421312.75, 562949953421312.0), - TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0), - TEST_f_f (rint, -70368744177664.75, -70368744177664.0), - TEST_f_f (rint, -140737488355328.75, -140737488355328.0), - TEST_f_f (rint, -281474976710656.75, -281474976710656.0), - TEST_f_f (rint, -562949953421312.75, -562949953421312.0), - TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0), + TEST_f_f (rint, 2.0, 2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 1.5, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1.0, 1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.5, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.0, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, minus_zero, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -0.5, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1.0, -1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -1.5, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2.0, -2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.1, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.25, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.625, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.1, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.25, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.625, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1048576.75, 1048576.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2097152.75, 2097152.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1048576.75, -1048576.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2097152.75, -2097152.0, INEXACT_EXCEPTION), +#ifndef TEST_FLOAT + TEST_f_f (rint, 70368744177664.75, 70368744177664.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 140737488355328.75, 140737488355328.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 281474976710656.75, 281474976710656.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 562949953421312.75, 562949953421312.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -70368744177664.75, -70368744177664.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -140737488355328.75, -140737488355328.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -281474976710656.75, -281474976710656.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -562949953421312.75, -562949953421312.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0, INEXACT_EXCEPTION), #endif #ifdef TEST_LDOUBLE /* The result can only be represented in long double. */ - TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L), + TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370494.0L), - TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L), + TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370494.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L, INEXACT_EXCEPTION), # endif - TEST_f_f (rint, -4503599627370495.5L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.75L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370497.5L, -4503599627370497.0L), + TEST_f_f (rint, -4503599627370495.5L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.75L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370497.5L, -4503599627370497.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370494.0L), - TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370496.0L), - - TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L), - TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L), - TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L), - - TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L), - TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740991.0L), - TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740993.0L), + TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370494.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370496.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), # endif #endif END_DATA (rint_towardzero) @@ -13113,73 +13120,73 @@ rint_test_towardzero (void) static const struct test_f_f_data rint_downward_test_data[] = { START_DATA (rint_downward), - TEST_f_f (rint, 2.0, 2.0), - TEST_f_f (rint, 1.5, 1.0), - TEST_f_f (rint, 1.0, 1.0), - TEST_f_f (rint, 0.5, 0.0), - TEST_f_f (rint, 0.0, 0.0), - TEST_f_f (rint, minus_zero, minus_zero), - TEST_f_f (rint, -0.5, -1.0), - TEST_f_f (rint, -1.0, -1.0), - TEST_f_f (rint, -1.5, -2.0), - TEST_f_f (rint, -2.0, -2.0), - TEST_f_f (rint, 0.1, 0.0), - TEST_f_f (rint, 0.25, 0.0), - TEST_f_f (rint, 0.625, 0.0), - TEST_f_f (rint, -0.1, -1.0), - TEST_f_f (rint, -0.25, -1.0), - TEST_f_f (rint, -0.625, -1.0), - TEST_f_f (rint, 1048576.75, 1048576.0), - TEST_f_f (rint, 2097152.75, 2097152.0), - TEST_f_f (rint, -1048576.75, -1048577.0), - TEST_f_f (rint, -2097152.75, -2097153.0), -#ifndef TEST_FLOAT - TEST_f_f (rint, 70368744177664.75, 70368744177664.0), - TEST_f_f (rint, 140737488355328.75, 140737488355328.0), - TEST_f_f (rint, 281474976710656.75, 281474976710656.0), - TEST_f_f (rint, 562949953421312.75, 562949953421312.0), - TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0), - TEST_f_f (rint, -70368744177664.75, -70368744177665.0), - TEST_f_f (rint, -140737488355328.75, -140737488355329.0), - TEST_f_f (rint, -281474976710656.75, -281474976710657.0), - TEST_f_f (rint, -562949953421312.75, -562949953421313.0), - TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0), + TEST_f_f (rint, 2.0, 2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 1.5, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1.0, 1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.5, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.0, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, minus_zero, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -0.5, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1.0, -1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -1.5, -2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2.0, -2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.1, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.25, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.625, 0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.1, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.25, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.625, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1048576.75, 1048576.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2097152.75, 2097152.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1048576.75, -1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2097152.75, -2097153.0, INEXACT_EXCEPTION), +#ifndef TEST_FLOAT + TEST_f_f (rint, 70368744177664.75, 70368744177664.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 140737488355328.75, 140737488355328.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 281474976710656.75, 281474976710656.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 562949953421312.75, 562949953421312.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -70368744177664.75, -70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -140737488355328.75, -140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -281474976710656.75, -281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -562949953421312.75, -562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0, INEXACT_EXCEPTION), #endif #ifdef TEST_LDOUBLE /* The result can only be represented in long double. */ - TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L), + TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370494.0L), - TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L), + TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370494.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L, INEXACT_EXCEPTION), # endif - TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.25L, -4503599627370497.0L), - TEST_f_f (rint, -4503599627370496.5L, -4503599627370497.0L), - TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L), - TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L), + TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.25L, -4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5L, -4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L), - - TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L), - TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L), - TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L), - - TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740994.0L), - TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L), + TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740994.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L, INEXACT_EXCEPTION), # endif #endif END_DATA (rint_downward) @@ -13196,73 +13203,73 @@ rint_test_downward (void) static const struct test_f_f_data rint_upward_test_data[] = { START_DATA (rint_upward), - TEST_f_f (rint, 2.0, 2.0), - TEST_f_f (rint, 1.5, 2.0), - TEST_f_f (rint, 1.0, 1.0), - TEST_f_f (rint, 0.5, 1.0), - TEST_f_f (rint, 0.0, 0.0), - TEST_f_f (rint, minus_zero, minus_zero), - TEST_f_f (rint, -0.5, -0.0), - TEST_f_f (rint, -1.0, -1.0), - TEST_f_f (rint, -1.5, -1.0), - TEST_f_f (rint, -2.0, -2.0), - TEST_f_f (rint, 0.1, 1.0), - TEST_f_f (rint, 0.25, 1.0), - TEST_f_f (rint, 0.625, 1.0), - TEST_f_f (rint, -0.1, -0.0), - TEST_f_f (rint, -0.25, -0.0), - TEST_f_f (rint, -0.625, -0.0), - TEST_f_f (rint, 1048576.75, 1048577.0), - TEST_f_f (rint, 2097152.75, 2097153.0), - TEST_f_f (rint, -1048576.75, -1048576.0), - TEST_f_f (rint, -2097152.75, -2097152.0), -#ifndef TEST_FLOAT - TEST_f_f (rint, 70368744177664.75, 70368744177665.0), - TEST_f_f (rint, 140737488355328.75, 140737488355329.0), - TEST_f_f (rint, 281474976710656.75, 281474976710657.0), - TEST_f_f (rint, 562949953421312.75, 562949953421313.0), - TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0), - TEST_f_f (rint, -70368744177664.75, -70368744177664.0), - TEST_f_f (rint, -140737488355328.75, -140737488355328.0), - TEST_f_f (rint, -281474976710656.75, -281474976710656.0), - TEST_f_f (rint, -562949953421312.75, -562949953421312.0), - TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0), + TEST_f_f (rint, 2.0, 2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 1.5, 2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1.0, 1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.5, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.0, 0.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, minus_zero, minus_zero, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -0.5, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1.0, -1.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, -1.5, -1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2.0, -2.0, NO_INEXACT_EXCEPTION), + TEST_f_f (rint, 0.1, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.25, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.625, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.1, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.25, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.625, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1048576.75, 1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2097152.75, 2097153.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1048576.75, -1048576.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2097152.75, -2097152.0, INEXACT_EXCEPTION), +#ifndef TEST_FLOAT + TEST_f_f (rint, 70368744177664.75, 70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 140737488355328.75, 140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 281474976710656.75, 281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 562949953421312.75, 562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -70368744177664.75, -70368744177664.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -140737488355328.75, -140737488355328.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -281474976710656.75, -281474976710656.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -562949953421312.75, -562949953421312.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0, INEXACT_EXCEPTION), #endif #ifdef TEST_LDOUBLE /* The result can only be represented in long double. */ - TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.25L, 4503599627370497.0L), - TEST_f_f (rint, 4503599627370496.5L, 4503599627370497.0L), - TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L), - TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L), + TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.25L, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5L, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L), - TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L), - TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L), + TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L, INEXACT_EXCEPTION), # endif - TEST_f_f (rint, -4503599627370495.5L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370496.75L, -4503599627370496.0L), - TEST_f_f (rint, -4503599627370497.5L, -4503599627370497.0L), + TEST_f_f (rint, -4503599627370495.5L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.75L, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370497.5L, -4503599627370497.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370494.0L), - TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370495.0L), - TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370496.0L), - - TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740994.0L), - TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L), - TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L), - TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L), - - TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L), - TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L), - TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740991.0L), - TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740992.0L), - TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740993.0L), + TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370494.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370496.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740994.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION), # endif #endif END_DATA (rint_upward) |