aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-26 01:04:54 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-26 01:04:54 +0000
commit0c59a1963e948c546e0d3e34de974c7e71de1134 (patch)
treed2d20501ed445fc7e36e3cb4b0491a744c982976 /math
parent4bbf8999f4d93c5da77737ccf06a1aa67225d3f4 (diff)
downloadglibc-0c59a1963e948c546e0d3e34de974c7e71de1134.tar
glibc-0c59a1963e948c546e0d3e34de974c7e71de1134.tar.gz
glibc-0c59a1963e948c546e0d3e34de974c7e71de1134.tar.bz2
glibc-0c59a1963e948c546e0d3e34de974c7e71de1134.zip
* sysdeps/i386/fpu/s_cos.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_cosf.S: Likewise. * sysdeps/i386/fpu/s_cosl.S: Likewise. * sysdeps/i386/fpu/s_sin.S: Likewise. * sysdeps/i386/fpu/s_sinf.S: Likewise. * sysdeps/i386/fpu/s_sinl.S: Likewise. * sysdeps/ieee754/dbl-64/s_sin.c: Likewise. * sysdeps/ieee754/flt-32/s_cosf.c: Likewise. * sysdeps/ieee754/flt-32/s_sinf.c: Likewise. * sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise. * sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise. * sysdeps/x86_64/fpu/s_cosl.S: Likewise. * sysdeps/x86_64/fpu/s_sinl.S: Likewise. * math/libm-test.inc: Add tests for errno after sin/cos calls with ±Inf.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc14
1 files changed, 13 insertions, 1 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 68f2f05a70..5f4dbe7fa1 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2006, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1997.
@@ -1993,9 +1993,15 @@ cos_test (void)
TEST_f_f (cos, 0, 1);
TEST_f_f (cos, minus_zero, 1);
+ errno = 0;
TEST_f_f (cos, plus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for cos(+inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (cos, minus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for cos(-inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (cos, nan_value, nan_value);
+ check_int ("errno for cos(NaN) unchanged", errno, 0, 0, 0, 0);
TEST_f_f (cos, M_PI_6l * 2.0, 0.5);
TEST_f_f (cos, M_PI_6l * 4.0, -0.5);
@@ -5497,9 +5503,15 @@ sin_test (void)
TEST_f_f (sin, 0, 0);
TEST_f_f (sin, minus_zero, minus_zero);
+ errno = 0;
TEST_f_f (sin, plus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for sin(+inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (sin, minus_infty, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for sin(-inf) == EDOM", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_f_f (sin, nan_value, nan_value);
+ check_int ("errno for sin(NaN) unchanged", errno, 0, 0, 0, 0);
TEST_f_f (sin, M_PI_6l, 0.5);
TEST_f_f (sin, -M_PI_6l, -0.5);