diff options
Diffstat (limited to 'math')
-rwxr-xr-x | math/gen-libm-test.pl | 140 | ||||
-rw-r--r-- | math/libm-test.inc | 1402 |
2 files changed, 258 insertions, 1284 deletions
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl index 097488c17c..36cc7eb818 100755 --- a/math/gen-libm-test.pl +++ b/math/gen-libm-test.pl @@ -158,6 +158,7 @@ sub parse_args { my (@special); my ($call_args); my ($ignore_result_any, $ignore_result_all); + my ($num_res, @args_res, $start_rm, $this_start_rm); ($descr_args, $descr_res) = split /_/,$descr, 2; @@ -194,32 +195,39 @@ sub parse_args { } # Result + @args_res = @args[$current_arg .. $#args]; + $num_res = 0; @descr = split //,$descr_res; foreach (@descr) { if ($_ =~ /f|i|l|L/) { - ++$current_arg; + ++$num_res; } elsif ($_ eq 'c') { - $current_arg += 2; + $num_res += 2; } elsif ($_ eq 'b') { # boolean - ++$current_arg; + ++$num_res; } elsif ($_ eq '1') { - ++$current_arg; + ++$num_res; } else { die ("$_ is unknown"); } } # consistency check - if ($current_arg == $#args) { + if ($#args_res == $num_res - 1) { + # One set of results for all rounding modes, no flags. + $start_rm = [ 0, 0, 0, 0 ]; + } elsif ($#args_res == $num_res) { + # One set of results for all rounding modes, with flags. die ("wrong number of arguments") - unless ($args[$current_arg] =~ /EXCEPTION|ERRNO|IGNORE_ZERO_INF_SIGN|TEST_NAN_SIGN|NO_TEST_INLINE|XFAIL_TEST/); - } elsif ($current_arg < $#args) { - die ("wrong number of arguments"); - } elsif ($current_arg > ($#args+1)) { + unless ($args_res[$#args_res] =~ /EXCEPTION|ERRNO|IGNORE_ZERO_INF_SIGN|TEST_NAN_SIGN|NO_TEST_INLINE|XFAIL_TEST/); + $start_rm = [ 0, 0, 0, 0 ]; + } elsif ($#args_res == 4 * $num_res + 3) { + # One set of results per rounding mode, with flags. + $start_rm = [ 0, $num_res + 1, 2 * $num_res + 2, 3 * $num_res + 3 ]; + } else { die ("wrong number of arguments"); } - # Put the C program line together # Reset some variables to start again $current_arg = 1; @@ -245,64 +253,68 @@ sub parse_args { } @descr = split //,$descr_res; - $ignore_result_any = 0; - $ignore_result_all = 1; - $cline_res = ""; - foreach (@descr) { - if ($_ =~ /b|f|i|l|L/ ) { - my ($result) = $args[$current_arg]; - if ($result eq "IGNORE") { - $ignore_result_any = 1; - $result = "0"; - } else { - $ignore_result_all = 0; - } - $cline_res .= ", $result"; - $current_arg++; - } elsif ($_ eq 'c') { - my ($result1) = $args[$current_arg]; - if ($result1 eq "IGNORE") { - $ignore_result_any = 1; - $result1 = "0"; - } else { - $ignore_result_all = 0; - } - my ($result2) = $args[$current_arg + 1]; - if ($result2 eq "IGNORE") { - $ignore_result_any = 1; - $result2 = "0"; - } else { - $ignore_result_all = 0; + foreach $this_start_rm (@$start_rm) { + $current_arg = $this_start_rm; + $ignore_result_any = 0; + $ignore_result_all = 1; + $cline_res = ""; + @special = (); + foreach (@descr) { + if ($_ =~ /b|f|i|l|L/ ) { + my ($result) = $args_res[$current_arg]; + if ($result eq "IGNORE") { + $ignore_result_any = 1; + $result = "0"; + } else { + $ignore_result_all = 0; + } + $cline_res .= ", $result"; + $current_arg++; + } elsif ($_ eq 'c') { + my ($result1) = $args_res[$current_arg]; + if ($result1 eq "IGNORE") { + $ignore_result_any = 1; + $result1 = "0"; + } else { + $ignore_result_all = 0; + } + my ($result2) = $args_res[$current_arg + 1]; + if ($result2 eq "IGNORE") { + $ignore_result_any = 1; + $result2 = "0"; + } else { + $ignore_result_all = 0; + } + $cline_res .= ", $result1, $result2"; + $current_arg += 2; + } elsif ($_ eq '1') { + push @special, $args_res[$current_arg]; + ++$current_arg; } - $cline_res .= ", $result1, $result2"; - $current_arg += 2; - } elsif ($_ eq '1') { - push @special, $args[$current_arg]; - ++$current_arg; } - } - if ($ignore_result_any && !$ignore_result_all) { - die ("some but not all function results ignored\n"); - } - # Add exceptions. - $cline_res .= show_exceptions ($ignore_result_any, - ($current_arg <= $#args) - ? $args[$current_arg] - : undef); - - # special treatment for some functions - $i = 0; - foreach (@special) { - ++$i; - my ($extra_expected) = $_; - my ($run_extra) = ($extra_expected ne "IGNORE" ? 1 : 0); - if (!$run_extra) { - $extra_expected = "0"; + if ($ignore_result_any && !$ignore_result_all) { + die ("some but not all function results ignored\n"); + } + # Add exceptions. + $cline_res .= show_exceptions ($ignore_result_any, + ($current_arg <= $#args_res) + ? $args_res[$current_arg] + : undef); + + # special treatment for some functions + $i = 0; + foreach (@special) { + ++$i; + my ($extra_expected) = $_; + my ($run_extra) = ($extra_expected ne "IGNORE" ? 1 : 0); + if (!$run_extra) { + $extra_expected = "0"; + } + $cline_res .= ", $run_extra, $extra_expected"; } - $cline_res .= ", $run_extra, $extra_expected"; + $cline_res =~ s/^, //; + $cline .= ", { $cline_res }"; } - $cline_res =~ s/^, //; - $cline .= ", { $cline_res }, { $cline_res }, { $cline_res }, { $cline_res }"; print $file " $cline },\n"; } diff --git a/math/libm-test.inc b/math/libm-test.inc index 2c0130b6d5..2a458168c8 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -8229,28 +8229,29 @@ gamma_test (void) static const struct test_f_l_data lrint_test_data[] = { - /* XXX this test is incomplete. We need to have a way to specifiy - the rounding method and test the critical cases. So far, only - unproblematic numbers are tested. */ TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION), TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION), TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION), TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION), TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.2L, 0, INEXACT_EXCEPTION), + TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION), + TEST_f_l (lrint, -0.2L, -1, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION), + TEST_f_l (lrint, 0.5L, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION), + TEST_f_l (lrint, -0.5L, -1, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION), + TEST_f_l (lrint, 0.8L, 0, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION), + TEST_f_l (lrint, -0.8L, -1, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -1.4L, -1, INEXACT_EXCEPTION), + TEST_f_l (lrint, 1.4L, 1, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION, 2, INEXACT_EXCEPTION), + TEST_f_l (lrint, -1.4L, -2, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION), - TEST_f_l (lrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_l (lrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), + TEST_f_l (lrint, 8388600.3L, 8388600, INEXACT_EXCEPTION, 8388600, INEXACT_EXCEPTION, 8388600, INEXACT_EXCEPTION, 8388601, INEXACT_EXCEPTION), + TEST_f_l (lrint, -8388600.3L, -8388601, INEXACT_EXCEPTION, -8388600, INEXACT_EXCEPTION, -8388600, INEXACT_EXCEPTION, -8388600, INEXACT_EXCEPTION), #ifndef TEST_FLOAT - TEST_f_l (lrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), - TEST_f_l (lrint, 1073741824.01, 1073741824, INEXACT_EXCEPTION), + TEST_f_l (lrint, 1071930.0008, 1071930, INEXACT_EXCEPTION, 1071930, INEXACT_EXCEPTION, 1071930, INEXACT_EXCEPTION, 1071931, INEXACT_EXCEPTION), + TEST_f_l (lrint, 1073741824.01, 1073741824, INEXACT_EXCEPTION, 1073741824, INEXACT_EXCEPTION, 1073741824, INEXACT_EXCEPTION, 1073741825, INEXACT_EXCEPTION), # if LONG_MAX > 281474976710656 && defined TEST_LDOUBLE - TEST_f_l (lrint, 281474976710656.025L, 281474976710656, INEXACT_EXCEPTION), + TEST_f_l (lrint, 281474976710656.025L, 281474976710656, INEXACT_EXCEPTION, 281474976710656, INEXACT_EXCEPTION, 281474976710656, INEXACT_EXCEPTION, 281474976710657, INEXACT_EXCEPTION), # endif #endif }; @@ -8258,185 +8259,28 @@ static const struct test_f_l_data lrint_test_data[] = static void lrint_test (void) { - START (lrint, 1); - RUN_TEST_LOOP_f_l (lrint, lrint_test_data, ); - END; -} - - -static const struct test_f_l_data lrint_tonearest_test_data[] = - { - TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.5L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.5L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.8L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.8L, -1, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -1.4L, -1, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_l (lrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_l (lrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), - TEST_f_l (lrint, 1073741824.01, 1073741824, INEXACT_EXCEPTION), -# if LONG_MAX > 281474976710656 && defined TEST_LDOUBLE - TEST_f_l (lrint, 281474976710656.025L, 281474976710656, INEXACT_EXCEPTION), -# endif -#endif - }; - -static void -lrint_test_tonearest (void) -{ - START (lrint_tonearest, 1); - RUN_TEST_LOOP_f_l (lrint, lrint_tonearest_test_data, FE_TONEAREST); - END; -} - - -static const struct test_f_l_data lrint_towardzero_test_data[] = - { - TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.5L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.5L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.8L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.8L, 0, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -1.4L, -1, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_l (lrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_l (lrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), - TEST_f_l (lrint, 1073741824.01, 1073741824, INEXACT_EXCEPTION), -# if LONG_MAX > 281474976710656 && defined TEST_LDOUBLE - TEST_f_l (lrint, 281474976710656.025L, 281474976710656, INEXACT_EXCEPTION), -# endif -#endif - }; - -static void -lrint_test_towardzero (void) -{ - START (lrint_towardzero, 1); - RUN_TEST_LOOP_f_l (lrint, lrint_towardzero_test_data, FE_TOWARDZERO); - END; -} - - -static const struct test_f_l_data lrint_downward_test_data[] = - { - TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.2L, -1, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.5L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.5L, -1, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.8L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.8L, -1, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -1.4L, -2, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_l (lrint, -8388600.3L, -8388601, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_l (lrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), - TEST_f_l (lrint, 1073741824.01, 1073741824, INEXACT_EXCEPTION), -# if LONG_MAX > 281474976710656 && defined TEST_LDOUBLE - TEST_f_l (lrint, 281474976710656.025L, 281474976710656, INEXACT_EXCEPTION), -# endif -#endif - }; - -static void -lrint_test_downward (void) -{ - START (lrint_downward, 1); - RUN_TEST_LOOP_f_l (lrint, lrint_downward_test_data, FE_DOWNWARD); - END; -} - - -static const struct test_f_l_data lrint_upward_test_data[] = - { - TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.2L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.2L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.5L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.5L, 0, INEXACT_EXCEPTION), - TEST_f_l (lrint, 0.8L, 1, INEXACT_EXCEPTION), - TEST_f_l (lrint, -0.8L, 0, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 1.4L, 2, INEXACT_EXCEPTION), - TEST_f_l (lrint, -1.4L, -1, INEXACT_EXCEPTION), - - TEST_f_l (lrint, 8388600.3L, 8388601, INEXACT_EXCEPTION), - TEST_f_l (lrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_l (lrint, 1071930.0008, 1071931, INEXACT_EXCEPTION), - TEST_f_l (lrint, 1073741824.01, 1073741825, INEXACT_EXCEPTION), -# if LONG_MAX > 281474976710656 && defined (TEST_LDOUBLE) - TEST_f_l (lrint, 281474976710656.025L, 281474976710657, INEXACT_EXCEPTION), -# endif -#endif - }; - -static void -lrint_test_upward (void) -{ - START (lrint_upward, 1); - RUN_TEST_LOOP_f_l (lrint, lrint_upward_test_data, FE_UPWARD); - END; + ALL_RM_TEST (lrint, 1, lrint_test_data, RUN_TEST_LOOP_f_l, END); } static const struct test_f_L_data llrint_test_data[] = { - /* XXX this test is incomplete. We need to have a way to specifiy - the rounding method and test the critical cases. So far, only - unproblematic numbers are tested. */ TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION), TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION), TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION), TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION), TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_L (llrint, -0.2L, 0, INEXACT_EXCEPTION), + TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION), + TEST_f_L (llrint, -0.2L, -1, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION, 0, INEXACT_EXCEPTION), - TEST_f_L (llrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_L (llrint, -1.4L, -1, INEXACT_EXCEPTION), + TEST_f_L (llrint, 1.4L, 1, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION, 1, INEXACT_EXCEPTION, 2, INEXACT_EXCEPTION), + TEST_f_L (llrint, -1.4L, -2, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION, -1, INEXACT_EXCEPTION), - TEST_f_L (llrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_L (llrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), + TEST_f_L (llrint, 8388600.3L, 8388600, INEXACT_EXCEPTION, 8388600, INEXACT_EXCEPTION, 8388600, INEXACT_EXCEPTION, 8388601, INEXACT_EXCEPTION), + TEST_f_L (llrint, -8388600.3L, -8388601, INEXACT_EXCEPTION, -8388600, INEXACT_EXCEPTION, -8388600, INEXACT_EXCEPTION, -8388600, INEXACT_EXCEPTION), #ifndef TEST_FLOAT - TEST_f_L (llrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), + TEST_f_L (llrint, 1071930.0008, 1071930, INEXACT_EXCEPTION, 1071930, INEXACT_EXCEPTION, 1071930, INEXACT_EXCEPTION, 1071931, INEXACT_EXCEPTION), #endif /* Test boundary conditions. */ @@ -8464,361 +8308,85 @@ static const struct test_f_L_data llrint_test_data[] = TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL, NO_INEXACT_EXCEPTION), #ifdef TEST_LDOUBLE /* The input can only be represented in long double. */ - TEST_f_L (llrint, 4503599627370495.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.75L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.5L, 4503599627370498LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL, INEXACT_EXCEPTION), -#endif - - TEST_f_L (llrint, 9007199254740991.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.75L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5L, 9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370495.5L, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370496.75L, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370497.5L, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370498LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370498LL, INEXACT_EXCEPTION), + + TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370496.25L, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370496.5L, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL, INEXACT_EXCEPTION, -4503599627370498LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL, INEXACT_EXCEPTION), -#endif - - TEST_f_L (llrint, 72057594037927935.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.75L, 72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927937.5L, 72057594037927938LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL, NO_INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370498LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370494LL, INEXACT_EXCEPTION, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370494LL, INEXACT_EXCEPTION, 4503599627370495LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370495LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION, 4503599627370496LL, INEXACT_EXCEPTION, 4503599627370497LL, INEXACT_EXCEPTION), + + TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370498LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION, -4503599627370494LL, INEXACT_EXCEPTION, -4503599627370494LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION, -4503599627370495LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370497LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION, -4503599627370496LL, INEXACT_EXCEPTION), # endif -#endif - }; -static void -llrint_test (void) -{ - START (llrint, 1); - RUN_TEST_LOOP_f_L (llrint, llrint_test_data, ); - END; -} + TEST_f_L (llrint, 9007199254740991.5L, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740992.75L, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740993.5L, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740994LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740994LL, INEXACT_EXCEPTION), -static const struct test_f_L_data llrint_tonearest_test_data[] = - { - TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_L (llrint, -0.2L, 0, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_L (llrint, -1.4L, -1, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_L (llrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_L (llrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), -#endif - - /* Test boundary conditions. */ - /* 0x1FFFFF */ - TEST_f_L (llrint, 2097151.0,2097151LL, NO_INEXACT_EXCEPTION), - /* 0x800000 */ - TEST_f_L (llrint, 8388608.0, 8388608LL, NO_INEXACT_EXCEPTION), - /* 0x1000000 */ - TEST_f_L (llrint, 16777216.0, 16777216LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000 */ - TEST_f_L (llrint, 2199023255552.0, 2199023255552LL, NO_INEXACT_EXCEPTION), - /* 0x40000000000 */ - TEST_f_L (llrint, 4398046511104.0, 4398046511104LL, NO_INEXACT_EXCEPTION), - /* 0x1000000000000 */ - TEST_f_L (llrint, 281474976710656.0, 281474976710656LL, NO_INEXACT_EXCEPTION), - /* 0x10000000000000 */ - TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL, NO_INEXACT_EXCEPTION), - /* 0x10000080000000 */ - TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000000 */ - TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL, NO_INEXACT_EXCEPTION), - /* 0x80000000000000 */ - TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL, NO_INEXACT_EXCEPTION), - /* 0x100000000000000 */ - TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL, NO_INEXACT_EXCEPTION), -#ifdef TEST_LDOUBLE - /* The input can only be represented in long double. */ - TEST_f_L (llrint, 4503599627370495.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.75L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.5L, 4503599627370498LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL, INEXACT_EXCEPTION), -#endif - - TEST_f_L (llrint, 9007199254740991.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.75L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5L, 9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740992.25L, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740992.5L, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL, INEXACT_EXCEPTION, -9007199254740994LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL, INEXACT_EXCEPTION), -#endif - - TEST_f_L (llrint, 72057594037927935.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.75L, 72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927937.5L, 72057594037927938LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL, NO_INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740994LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740991LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740992LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740994LL, INEXACT_EXCEPTION, 9007199254740993LL, INEXACT_EXCEPTION, 9007199254740994LL, INEXACT_EXCEPTION), + + TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740994LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION, -9007199254740991LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION, -9007199254740992LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL, INEXACT_EXCEPTION, -9007199254740994LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION, -9007199254740993LL, INEXACT_EXCEPTION), # endif -#endif - }; -static void -llrint_test_tonearest (void) -{ - START (llrint_tonearest, 1); - RUN_TEST_LOOP_f_L (llrint, llrint_tonearest_test_data, FE_TONEAREST); - END; -} - -static const struct test_f_L_data llrint_towardzero_test_data[] = - { - TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_L (llrint, -0.2L, 0, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_L (llrint, -1.4L, -1, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_L (llrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_L (llrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), -#endif - - /* Test boundary conditions. */ - /* 0x1FFFFF */ - TEST_f_L (llrint, 2097151.0,2097151LL, NO_INEXACT_EXCEPTION), - /* 0x800000 */ - TEST_f_L (llrint, 8388608.0, 8388608LL, NO_INEXACT_EXCEPTION), - /* 0x1000000 */ - TEST_f_L (llrint, 16777216.0, 16777216LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000 */ - TEST_f_L (llrint, 2199023255552.0, 2199023255552LL, NO_INEXACT_EXCEPTION), - /* 0x40000000000 */ - TEST_f_L (llrint, 4398046511104.0, 4398046511104LL, NO_INEXACT_EXCEPTION), - /* 0x1000000000000 */ - TEST_f_L (llrint, 281474976710656.0, 281474976710656LL, NO_INEXACT_EXCEPTION), - /* 0x10000000000000 */ - TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL, NO_INEXACT_EXCEPTION), - /* 0x10000080000000 */ - TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000000 */ - TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL, NO_INEXACT_EXCEPTION), - /* 0x80000000000000 */ - TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL, NO_INEXACT_EXCEPTION), - /* 0x100000000000000 */ - TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL, NO_INEXACT_EXCEPTION), -#ifdef TEST_LDOUBLE - /* The input can only be represented in long double. */ - TEST_f_L (llrint, 4503599627370495.5L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.75L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.5L, 4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.5L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.75L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.5L, -4503599627370497LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370494LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370496LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370494LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370496LL, INEXACT_EXCEPTION), -#endif - - TEST_f_L (llrint, 9007199254740991.5L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.75L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5L, 9007199254740993LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.5L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.75L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5L, -9007199254740993LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 72057594037927935.5L, 72057594037927935LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927935LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927937LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927937LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 72057594037927936.75L, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927937LL, INEXACT_EXCEPTION, 72057594037927936LL, INEXACT_EXCEPTION, 72057594037927937LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 72057594037927937.5L, 72057594037927937LL, INEXACT_EXCEPTION, 72057594037927938LL, INEXACT_EXCEPTION, 72057594037927937LL, INEXACT_EXCEPTION, 72057594037927938LL, INEXACT_EXCEPTION), -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740993LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740993LL, INEXACT_EXCEPTION), -#endif - - TEST_f_L (llrint, 72057594037927935.5L, 72057594037927935LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.75L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927937.5L, 72057594037927937LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -72057594037927935.5L, -72057594037927935LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.75L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927937.5L, -72057594037927937LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927935LL, INEXACT_EXCEPTION, -72057594037927935LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -72057594037927936.25L, -72057594037927937LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -72057594037927936.5L, -72057594037927937LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL, INEXACT_EXCEPTION, -72057594037927937LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION, -72057594037927936LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL, INEXACT_EXCEPTION, -72057594037927938LL, INEXACT_EXCEPTION, -72057594037927937LL, INEXACT_EXCEPTION, -72057594037927937LL, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775805LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775805LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775805LL, INEXACT_EXCEPTION, 9223372036854775806LL, INEXACT_EXCEPTION, 9223372036854775805LL, INEXACT_EXCEPTION, 9223372036854775806LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775805LL, INEXACT_EXCEPTION, -9223372036854775805LL, INEXACT_EXCEPTION), TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL, NO_INEXACT_EXCEPTION), TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775806LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL, INEXACT_EXCEPTION, 9223372036854775806LL, INEXACT_EXCEPTION, 9223372036854775806LL, INEXACT_EXCEPTION, 9223372036854775807LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775807LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L, INEXACT_EXCEPTION, 9223372036854775806L, INEXACT_EXCEPTION, 9223372036854775806L, INEXACT_EXCEPTION, 9223372036854775807L, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775807LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775806LL, INEXACT_EXCEPTION, 9223372036854775807LL, INEXACT_EXCEPTION, 9223372036854775806LL, INEXACT_EXCEPTION, 9223372036854775807LL, INEXACT_EXCEPTION), + TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL, INEXACT_EXCEPTION, -9223372036854775807LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION, -9223372036854775806LL, INEXACT_EXCEPTION), TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL, NO_INEXACT_EXCEPTION), TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL, NO_INEXACT_EXCEPTION), # endif @@ -8826,277 +8394,9 @@ static const struct test_f_L_data llrint_towardzero_test_data[] = }; static void -llrint_test_towardzero (void) -{ - START (llrint_towardzero, 1); - RUN_TEST_LOOP_f_L (llrint, llrint_towardzero_test_data, FE_TOWARDZERO); - END; -} - -static const struct test_f_L_data llrint_downward_test_data[] = - { - TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION), - TEST_f_L (llrint, -0.2L, -1, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 1.4L, 1, INEXACT_EXCEPTION), - TEST_f_L (llrint, -1.4L, -2, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 8388600.3L, 8388600, INEXACT_EXCEPTION), - TEST_f_L (llrint, -8388600.3L, -8388601, INEXACT_EXCEPTION), - -#ifndef TEST_FLOAT - TEST_f_L (llrint, 1071930.0008, 1071930, INEXACT_EXCEPTION), -#endif - - /* Test boundary conditions. */ - /* 0x1FFFFF */ - TEST_f_L (llrint, 2097151.0,2097151LL, NO_INEXACT_EXCEPTION), - /* 0x800000 */ - TEST_f_L (llrint, 8388608.0, 8388608LL, NO_INEXACT_EXCEPTION), - /* 0x1000000 */ - TEST_f_L (llrint, 16777216.0, 16777216LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000 */ - TEST_f_L (llrint, 2199023255552.0, 2199023255552LL, NO_INEXACT_EXCEPTION), - /* 0x40000000000 */ - TEST_f_L (llrint, 4398046511104.0, 4398046511104LL, NO_INEXACT_EXCEPTION), - /* 0x1000000000000 */ - TEST_f_L (llrint, 281474976710656.0, 281474976710656LL, NO_INEXACT_EXCEPTION), - /* 0x10000000000000 */ - TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL, NO_INEXACT_EXCEPTION), - /* 0x10000080000000 */ - TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000000 */ - TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL, NO_INEXACT_EXCEPTION), - /* 0x80000000000000 */ - TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL, NO_INEXACT_EXCEPTION), - /* 0x100000000000000 */ - TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL, NO_INEXACT_EXCEPTION), -#ifdef TEST_LDOUBLE - /* The input can only be represented in long double. */ - TEST_f_L (llrint, 4503599627370495.5L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.75L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.5L, 4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370494LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370496LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.25L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370498LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 9007199254740991.5L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.75L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5L, 9007199254740993LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740993LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.25L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740994LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 72057594037927935.5L, 72057594037927935LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.75L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927937.5L, 72057594037927937LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.25L, -72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.5L, -72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775805LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL, NO_INEXACT_EXCEPTION), -# endif -#endif - }; - -static void -llrint_test_downward (void) -{ - START (llrint_downward, 1); - RUN_TEST_LOOP_f_L (llrint, llrint_downward_test_data, FE_DOWNWARD); - END; -} - -static const struct test_f_L_data llrint_upward_test_data[] = - { - TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION), - TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 0.2L, 1, INEXACT_EXCEPTION), - TEST_f_L (llrint, -0.2L, 0, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 1.4L, 2, INEXACT_EXCEPTION), - TEST_f_L (llrint, -1.4L, -1, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 8388600.3L, 8388601, INEXACT_EXCEPTION), - TEST_f_L (llrint, -8388600.3L, -8388600, INEXACT_EXCEPTION), -#ifndef TEST_FLOAT - TEST_f_L (llrint, 1071930.0008, 1071931, INEXACT_EXCEPTION), -#endif - /* Test boundary conditions. */ - /* 0x1FFFFF */ - TEST_f_L (llrint, 2097151.0,2097151LL, NO_INEXACT_EXCEPTION), - /* 0x800000 */ - TEST_f_L (llrint, 8388608.0, 8388608LL, NO_INEXACT_EXCEPTION), - /* 0x1000000 */ - TEST_f_L (llrint, 16777216.0, 16777216LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000 */ - TEST_f_L (llrint, 2199023255552.0, 2199023255552LL, NO_INEXACT_EXCEPTION), - /* 0x40000000000 */ - TEST_f_L (llrint, 4398046511104.0, 4398046511104LL, NO_INEXACT_EXCEPTION), - /* 0x1000000000000 */ - TEST_f_L (llrint, 281474976710656.0, 281474976710656LL, NO_INEXACT_EXCEPTION), - /* 0x10000000000000 */ - TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL, NO_INEXACT_EXCEPTION), - /* 0x10000080000000 */ - TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL, NO_INEXACT_EXCEPTION), - /* 0x20000000000000 */ - TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL, NO_INEXACT_EXCEPTION), - /* 0x80000000000000 */ - TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL, NO_INEXACT_EXCEPTION), - /* 0x100000000000000 */ - TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL, NO_INEXACT_EXCEPTION), -#ifdef TEST_LDOUBLE - /* The input can only be represented in long double. */ - TEST_f_L (llrint, 4503599627370495.5L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.25L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.75L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.5L, 4503599627370498LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370498LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.5L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.75L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.5L, -4503599627370497LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370494LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370495LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370496LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 9007199254740991.5L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.25L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.75L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5L, 9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740994LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740994LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.5L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.75L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5L, -9007199254740993LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740991LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740992LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740993LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, 72057594037927935.5L, 72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.25L, 72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.5L, 72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927936.75L, 72057594037927937LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 72057594037927937.5L, 72057594037927938LL, INEXACT_EXCEPTION), - - TEST_f_L (llrint, -72057594037927935.5L, -72057594037927935LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927936.75L, -72057594037927936LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -72057594037927937.5L, -72057594037927937LL, INEXACT_EXCEPTION), - -# if LDBL_MANT_DIG > 100 - TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775805LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775807L, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775807LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775806LL, INEXACT_EXCEPTION), - TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL, NO_INEXACT_EXCEPTION), - TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL, NO_INEXACT_EXCEPTION), -# endif -#endif - }; - -static void -llrint_test_upward (void) +llrint_test (void) { - START (llrint_upward, 1); - RUN_TEST_LOOP_f_L (llrint, llrint_upward_test_data, FE_UPWARD); - END; + ALL_RM_TEST (llrint, 1, llrint_test_data, RUN_TEST_LOOP_f_L, END); } @@ -10093,452 +9393,126 @@ static const struct test_f_f_data rint_test_data[] = { /* TODO: missing qNaN tests. */ - 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, 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, 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, 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, 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, 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, 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 - }; - -static void -rint_test (void) -{ - START (rint, 1); - RUN_TEST_LOOP_f_f (rint, rint_test_data, ); - END; -} - -static const struct test_f_f_data rint_tonearest_test_data[] = - { + TEST_f_f (rint, 4.5, 4.0, INEXACT_EXCEPTION, 4.0, INEXACT_EXCEPTION, 4.0, INEXACT_EXCEPTION, 5.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 3.5, 3.0, INEXACT_EXCEPTION, 4.0, INEXACT_EXCEPTION, 3.0, INEXACT_EXCEPTION, 4.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2.5, 2.0, INEXACT_EXCEPTION, 2.0, INEXACT_EXCEPTION, 2.0, INEXACT_EXCEPTION, 3.0, INEXACT_EXCEPTION), 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.5, 1.0, INEXACT_EXCEPTION, 2.0, INEXACT_EXCEPTION, 1.0, INEXACT_EXCEPTION, 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.5, 0.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 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, -0.5, -1.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -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, -1.5, -2.0, INEXACT_EXCEPTION, -2.0, INEXACT_EXCEPTION, -1.0, INEXACT_EXCEPTION, -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, 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), + TEST_f_f (rint, -2.5, -3.0, INEXACT_EXCEPTION, -2.0, INEXACT_EXCEPTION, -2.0, INEXACT_EXCEPTION, -2.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -3.5, -4.0, INEXACT_EXCEPTION, -4.0, INEXACT_EXCEPTION, -3.0, INEXACT_EXCEPTION, -3.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -4.5, -5.0, INEXACT_EXCEPTION, -4.0, INEXACT_EXCEPTION, -4.0, INEXACT_EXCEPTION, -4.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.1, 0.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.25, 0.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 0.625, 0.0, INEXACT_EXCEPTION, 1.0, INEXACT_EXCEPTION, 0.0, INEXACT_EXCEPTION, 1.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.1, -1.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.25, -1.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -0.625, -1.0, INEXACT_EXCEPTION, -1.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION, -0.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 262144.75, 262144.0, INEXACT_EXCEPTION, 262145.0, INEXACT_EXCEPTION, 262144.0, INEXACT_EXCEPTION, 262145.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 262142.75, 262142.0, INEXACT_EXCEPTION, 262143.0, INEXACT_EXCEPTION, 262142.0, INEXACT_EXCEPTION, 262143.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 524286.75, 524286.0, INEXACT_EXCEPTION, 524287.0, INEXACT_EXCEPTION, 524286.0, INEXACT_EXCEPTION, 524287.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 524288.75, 524288.0, INEXACT_EXCEPTION, 524289.0, INEXACT_EXCEPTION, 524288.0, INEXACT_EXCEPTION, 524289.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1048576.75, 1048576.0, INEXACT_EXCEPTION, 1048577.0, INEXACT_EXCEPTION, 1048576.0, INEXACT_EXCEPTION, 1048577.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 2097152.75, 2097152.0, INEXACT_EXCEPTION, 2097153.0, INEXACT_EXCEPTION, 2097152.0, INEXACT_EXCEPTION, 2097153.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1048576.75, -1048577.0, INEXACT_EXCEPTION, -1048577.0, INEXACT_EXCEPTION, -1048576.0, INEXACT_EXCEPTION, -1048576.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -2097152.75, -2097153.0, INEXACT_EXCEPTION, -2097153.0, INEXACT_EXCEPTION, -2097152.0, INEXACT_EXCEPTION, -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, -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, 70368744177665.0, INEXACT_EXCEPTION, 70368744177664.0, INEXACT_EXCEPTION, 70368744177665.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 140737488355328.75, 140737488355328.0, INEXACT_EXCEPTION, 140737488355329.0, INEXACT_EXCEPTION, 140737488355328.0, INEXACT_EXCEPTION, 140737488355329.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 281474976710656.75, 281474976710656.0, INEXACT_EXCEPTION, 281474976710657.0, INEXACT_EXCEPTION, 281474976710656.0, INEXACT_EXCEPTION, 281474976710657.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 562949953421312.75, 562949953421312.0, INEXACT_EXCEPTION, 562949953421313.0, INEXACT_EXCEPTION, 562949953421312.0, INEXACT_EXCEPTION, 562949953421313.0, INEXACT_EXCEPTION), + TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0, INEXACT_EXCEPTION, 1125899906842625.0, INEXACT_EXCEPTION, 1125899906842624.0, INEXACT_EXCEPTION, 1125899906842625.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -70368744177664.75, -70368744177665.0, INEXACT_EXCEPTION, -70368744177665.0, INEXACT_EXCEPTION, -70368744177664.0, INEXACT_EXCEPTION, -70368744177664.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -140737488355328.75, -140737488355329.0, INEXACT_EXCEPTION, -140737488355329.0, INEXACT_EXCEPTION, -140737488355328.0, INEXACT_EXCEPTION, -140737488355328.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -281474976710656.75, -281474976710657.0, INEXACT_EXCEPTION, -281474976710657.0, INEXACT_EXCEPTION, -281474976710656.0, INEXACT_EXCEPTION, -281474976710656.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -562949953421312.75, -562949953421313.0, INEXACT_EXCEPTION, -562949953421313.0, INEXACT_EXCEPTION, -562949953421312.0, INEXACT_EXCEPTION, -562949953421312.0, INEXACT_EXCEPTION), + TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0, INEXACT_EXCEPTION, -1125899906842625.0, INEXACT_EXCEPTION, -1125899906842624.0, INEXACT_EXCEPTION, -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, 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), + TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370495.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L, INEXACT_EXCEPTION, 4503599627370498.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION, 4503599627370498.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - 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, 4503599627370494.5000000000001L, 4503599627370494.0L, INEXACT_EXCEPTION, 4503599627370495.0L, INEXACT_EXCEPTION, 4503599627370494.0L, INEXACT_EXCEPTION, 4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370495.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION, 4503599627370496.0L, INEXACT_EXCEPTION, 4503599627370497.0L, INEXACT_EXCEPTION), # endif - 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), + TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370495.0L, INEXACT_EXCEPTION, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.25L, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5L, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L, INEXACT_EXCEPTION, -4503599627370498.0L, INEXACT_EXCEPTION, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370497.0L, INEXACT_EXCEPTION), # if LDBL_MANT_DIG > 100 - 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), + TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L, INEXACT_EXCEPTION, -4503599627370495.0L, INEXACT_EXCEPTION, -4503599627370494.0L, INEXACT_EXCEPTION, -4503599627370494.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370495.0L, INEXACT_EXCEPTION, -4503599627370495.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370497.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION, -4503599627370496.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740994.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740994.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740994.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L, INEXACT_EXCEPTION, -9007199254740994.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION), # endif -#endif - }; -static void -rint_test_tonearest (void) -{ - START (rint_tonearest, 1); - RUN_TEST_LOOP_f_f (rint, rint_tonearest_test_data, FE_TONEAREST); - END; -} + TEST_f_f (rint, 9007199254740991.5L, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740991.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.25L, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.5L, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740992.75L, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740992.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 9007199254740993.5L, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740994.0L, INEXACT_EXCEPTION, 9007199254740993.0L, INEXACT_EXCEPTION, 9007199254740994.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -9007199254740991.5L, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION, -9007199254740991.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.25L, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.5L, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740992.75L, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION, -9007199254740992.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -9007199254740993.5L, -9007199254740994.0L, INEXACT_EXCEPTION, -9007199254740994.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION, -9007199254740993.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, 72057594037927935.5L, 72057594037927935.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927935.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927936.25L, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927937.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927936.5L, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927937.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927936.75L, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927937.0L, INEXACT_EXCEPTION, 72057594037927936.0L, INEXACT_EXCEPTION, 72057594037927937.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 72057594037927937.5L, 72057594037927937.0L, INEXACT_EXCEPTION, 72057594037927938.0L, INEXACT_EXCEPTION, 72057594037927937.0L, INEXACT_EXCEPTION, 72057594037927938.0L, INEXACT_EXCEPTION), + + TEST_f_f (rint, -72057594037927935.5L, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927935.0L, INEXACT_EXCEPTION, -72057594037927935.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927936.25L, -72057594037927937.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927936.5L, -72057594037927937.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927936.75L, -72057594037927937.0L, INEXACT_EXCEPTION, -72057594037927937.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION, -72057594037927936.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, -72057594037927937.5L, -72057594037927938.0L, INEXACT_EXCEPTION, -72057594037927938.0L, INEXACT_EXCEPTION, -72057594037927937.0L, INEXACT_EXCEPTION, -72057594037927937.0L, INEXACT_EXCEPTION), -static const struct test_f_f_data rint_towardzero_test_data[] = - { - 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, 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, 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, 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, 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), + TEST_f_f (rint, 10141204801825835211973625643007.5L, 10141204801825835211973625643007.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643007.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643008.75L, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION, 10141204801825835211973625643008.0L, INEXACT_EXCEPTION, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION), + TEST_f_f (rint, 10141204801825835211973625643009.5L, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION, 10141204801825835211973625643010.0L, INEXACT_EXCEPTION, 10141204801825835211973625643009.0L, INEXACT_EXCEPTION, 10141204801825835211973625643010.0L, INEXACT_EXCEPTION), # endif #endif }; static void -rint_test_towardzero (void) -{ - START (rint_towardzero, 1); - RUN_TEST_LOOP_f_f (rint, rint_towardzero_test_data, FE_TOWARDZERO); - END; -} - -static const struct test_f_f_data rint_downward_test_data[] = - { - 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, 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, 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, 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, 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 - }; - -static void -rint_test_downward (void) -{ - START (rint_downward, 1); - RUN_TEST_LOOP_f_f (rint, rint_downward_test_data, FE_DOWNWARD); - END; -} - -static const struct test_f_f_data rint_upward_test_data[] = - { - 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, 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, 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, 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, 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 - }; - -static void -rint_test_upward (void) +rint_test (void) { - START (rint_upward, 1); - RUN_TEST_LOOP_f_f (rint, rint_upward_test_data, FE_UPWARD); - END; + ALL_RM_TEST (rint, 1, rint_test_data, RUN_TEST_LOOP_f_f, END); } static const struct test_f_f_data round_test_data[] = @@ -11782,20 +10756,8 @@ main (int argc, char **argv) floor_test (); nearbyint_test (); rint_test (); - rint_test_tonearest (); - rint_test_towardzero (); - rint_test_downward (); - rint_test_upward (); lrint_test (); - lrint_test_tonearest (); - lrint_test_towardzero (); - lrint_test_downward (); - lrint_test_upward (); llrint_test (); - llrint_test_tonearest (); - llrint_test_towardzero (); - llrint_test_downward (); - llrint_test_upward (); round_test (); lround_test (); llround_test (); |