From 002a604fd61d1d3b8d82a5a85959ba4ebd210aec Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 26 Apr 2009 04:46:54 +0000 Subject: * 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. --- math/libm-test.inc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'math') diff --git a/math/libm-test.inc b/math/libm-test.inc index bed59e8..19025ec 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); -- cgit v1.1