aboutsummaryrefslogtreecommitdiff
path: root/math/libm-test-atanpi.inc
diff options
context:
space:
mode:
authorJoseph Myers <josmyers@redhat.com>2024-12-11 21:51:49 +0000
committerJoseph Myers <josmyers@redhat.com>2024-12-11 21:51:49 +0000
commitffe79c446ced76d7c1a77804ff2cc32eccbc7c7e (patch)
treefa436fea1f0eebeb843ae0c16df84f120f859eb3 /math/libm-test-atanpi.inc
parentaec85b2557cdb2cc1fc726a50c33848826f00f4d (diff)
downloadglibc-ffe79c446ced76d7c1a77804ff2cc32eccbc7c7e.tar.xz
glibc-ffe79c446ced76d7c1a77804ff2cc32eccbc7c7e.zip
Implement C23 atanpi
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the atanpi functions (atan(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
Diffstat (limited to 'math/libm-test-atanpi.inc')
-rw-r--r--math/libm-test-atanpi.inc49
1 files changed, 49 insertions, 0 deletions
diff --git a/math/libm-test-atanpi.inc b/math/libm-test-atanpi.inc
new file mode 100644
index 0000000000..d24919e471
--- /dev/null
+++ b/math/libm-test-atanpi.inc
@@ -0,0 +1,49 @@
+/* Test atanpi.
+ Copyright (C) 2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include "libm-test-driver.c"
+
+static const struct test_f_f_data atanpi_test_data[] =
+ {
+ TEST_f_f (atanpi, plus_infty, 0.5, ERRNO_UNCHANGED),
+ TEST_f_f (atanpi, minus_infty, -0.5, ERRNO_UNCHANGED),
+ TEST_f_f (atanpi, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_f (atanpi, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_f (atanpi, snan_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (atanpi, -snan_value, qnan_value, INVALID_EXCEPTION),
+
+ AUTO_TESTS_f_f (atanpi),
+ };
+
+static void
+atanpi_test (void)
+{
+ ALL_RM_TEST (atanpi, 0, atanpi_test_data, RUN_TEST_LOOP_f_f, END);
+}
+
+static void
+do_test (void)
+{
+ atanpi_test ();
+}
+
+/*
+ * Local Variables:
+ * mode:c
+ * End:
+ */