diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-04-26 04:46:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-04-26 04:46:54 +0000 |
commit | 002a604fd61d1d3b8d82a5a85959ba4ebd210aec (patch) | |
tree | a3988d512d41a34088190f531b8e4b5bd412ab48 /math | |
parent | 7095366d1efc6e58639f7c76d0b515212d61247d (diff) | |
download | glibc-002a604fd61d1d3b8d82a5a85959ba4ebd210aec.tar.gz |
* sysdeps/ieee754/k_standard.c (__kernel_standard): Use correct
errno value vor pow(+-0,neg).
* math/libm-test.inc (pow_test): Add tests for errno value for
pole errors.
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index bed59e8b72..19025ecebe 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -4742,15 +4742,31 @@ pow_test (void) TEST_ff_f (pow, -10.1L, 1.1L, nan_value, INVALID_EXCEPTION); TEST_ff_f (pow, -10.1L, -1.1L, nan_value, INVALID_EXCEPTION); + errno = 0; TEST_ff_f (pow, 0, -1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; TEST_ff_f (pow, 0, -11, plus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; TEST_ff_f (pow, minus_zero, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION); - TEST_ff_f (pow, minus_zero, -11, minus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; + TEST_ff_f (pow, minus_zero, -11L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; TEST_ff_f (pow, 0, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(0,-even) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; TEST_ff_f (pow, 0, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; TEST_ff_f (pow, minus_zero, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0); + errno = 0; TEST_ff_f (pow, minus_zero, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION); + check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0); TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty); TEST_ff_f (pow, 10, -0x1p72L, 0); @@ -4763,11 +4779,9 @@ pow_test (void) TEST_ff_f (pow, minus_zero, 1, minus_zero); TEST_ff_f (pow, minus_zero, 11, minus_zero); - TEST_ff_f (pow, 0, 2, 0); TEST_ff_f (pow, 0, 11.1L, 0); - TEST_ff_f (pow, minus_zero, 2, 0); TEST_ff_f (pow, minus_zero, 11.1L, 0); TEST_ff_f (pow, 0, plus_infty, 0); |