]> Savannah Git Hosting - gnulib.git/commitdiff
exp2l: Work around a NetBSD 10.0/i386 bug.
authorBruno Haible <bruno@clisp.org>
Fri, 5 Apr 2024 14:45:25 +0000 (16:45 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 5 Apr 2024 14:45:25 +0000 (16:45 +0200)
* m4/exp2l.m4 (gl_FUNC_EXP2L): Test the value of exp2l(LDBL_MAX_EXP-1).
* doc/posix-functions/exp2l.texi: Mention the NetBSD 10.0/i386 bug.

ChangeLog
doc/posix-functions/exp2l.texi
m4/exp2l.m4

index 017125b3531440835ecf5595bed56ba6791b95ce..ea2ed1b7ecb50c6803fd499c4ddb70a7dd8aab2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-05  Bruno Haible  <bruno@clisp.org>
+
+       exp2l: Work around a NetBSD 10.0/i386 bug.
+       * m4/exp2l.m4 (gl_FUNC_EXP2L): Test the value of exp2l(LDBL_MAX_EXP-1).
+       * doc/posix-functions/exp2l.texi: Mention the NetBSD 10.0/i386 bug.
+
 2024-04-05  Bruno Haible  <bruno@clisp.org>
 
        roundl: Fix a link error on Linux/powerpc64le.
index 777182ec510a00cb70e3ea6d5f1d2275f15e9f24..5de6d4746950642fc32865c4f97c52c401a39300 100644 (file)
@@ -15,9 +15,12 @@ FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, older IRIX
 This function is not declared on some platforms:
 IRIX 6.5.
 @item
+This function returns Infinity instead of large finite values on some platforms:
+NetBSD 10.0/i386.
+@item
 This function produces results which are accurate to only 16 digits on some
 platforms:
-NetBSD 10.0.
+NetBSD 10.0/x86_64.
 @end itemize
 
 Portability problems fixed by Gnulib module @code{exp2l-ieee}:
index 2dd134740c2f050663dba022ff0f457786d9704e..7de6f8de4b0655454449825eeabe884fe43e9cc5 100644 (file)
@@ -1,5 +1,5 @@
 # exp2l.m4
-# serial 14
+# serial 15
 dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -81,7 +81,7 @@ int main (int argc, char *argv[])
 {
   long double (* volatile my_exp2l) (long double) = argc ? exp2l : dummy;
   int result = 0;
-  /* This test fails on NetBSD 9.3.  */
+  /* This test fails on NetBSD 10.0/x86_64.  */
   {
     const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */
       (long double) (1U << ((LDBL_MANT_DIG - 1) / 5))
@@ -94,6 +94,13 @@ int main (int argc, char *argv[])
     if (!(err >= -100.0L && err <= 100.0L))
       result |= 1;
   }
+  /* This test fails on NetBSD 10.0/i386.  */
+  {
+    long double x = LDBL_MAX_EXP - 1;
+    long double z = my_exp2l (x);
+    if (z + z == z) /* isinf (z) */
+      result |= 2;
+  }
   return result;
 }
             ]])],