]> Savannah Git Hosting - gnulib.git/commitdiff
ilogbl: Fix test failures on AIX 7.1 in 64-bit mode.
authorBruno Haible <bruno@clisp.org>
Wed, 6 Jan 2021 10:06:55 +0000 (11:06 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 6 Jan 2021 10:12:03 +0000 (11:12 +0100)
* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Test also some denormalized
argument.
* doc/posix-functions/ilogbl.texi: Mention the AIX bug.

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

index 2adaf5a69688e1f89accfbf0ef97bb3d2a3a65aa..9b99954583fa1f0517cd62b359bf8dfcdae5e162 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-06  Bruno Haible  <bruno@clisp.org>
+
+       ilogbl: Fix test failures on AIX 7.1 in 64-bit mode.
+       * m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Test also some denormalized
+       argument.
+       * doc/posix-functions/ilogbl.texi: Mention the AIX bug.
+
 2021-01-06  Bruno Haible  <bruno@clisp.org>
 
        ilogb: Fix test failures on AIX 7.1 in 64-bit mode.
index d805e08acaffd9b3935faa33d8bdec8fda921abb..a038376f880d89bbb325235eb62dbfb6e9e0d38d 100644 (file)
@@ -17,7 +17,7 @@ This function returns a wrong result for a zero argument on some platforms:
 Cygwin 2.9.
 @item
 This function returns a wrong result for denormalized arguments on some platforms:
-Haiku 2017.
+AIX 7.1 64-bit, Haiku 2017.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 3575736d7cb99ba29f71cdb63c2124e004bcd05d..77830c18ebe1016cff09a8b95dca0ed69a309517 100644 (file)
@@ -1,4 +1,4 @@
-# ilogbl.m4 serial 4
+# ilogbl.m4 serial 5
 dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,7 +71,8 @@ AC_DEFUN([gl_FUNC_ILOGBL],
 ])
 
 dnl Test whether ilogbl() works.
-dnl On Cygwin 2.9, ilogb(0.0L) is wrong.
+dnl On Cygwin 2.9, ilogbl(0.0L) is wrong.
+dnl On AIX 7.1 in 64-bit mode, ilogbl(2^(LDBL_MIN_EXP-1)) is wrong.
 dnl On Haiku 2017, it returns i-2 instead of i-1 for values between
 dnl ca. 2^-16444 and ca. 2^-16382.
 AC_DEFUN([gl_FUNC_ILOGBL_WORKS],
@@ -115,13 +116,22 @@ int main (int argc, char *argv[])
     if (my_ilogbl (x) != FP_ILOGB0)
       result |= 1;
   }
+  /* This test fails on AIX 7.1 in 64-bit mode.  */
+  {
+    int i;
+    x = 0.5L;
+    for (i = LDBL_MIN_EXP - 1; i < 0; i++)
+      x = x * 0.5L;
+    if (x > 0.0L && my_ilogbl (x) != LDBL_MIN_EXP - 2)
+      result |= 2;
+  }
   /* This test fails on Haiku 2017.  */
   {
     int i;
     for (i = 1, x = (long double)1.0; i >= LDBL_MIN_EXP-100 && x > (long double)0.0; i--, x *= (long double)0.5)
       if (my_ilogbl (x) != i - 1)
         {
-          result |= 2;
+          result |= 4;
           break;
         }
   }
@@ -131,7 +141,8 @@ int main (int argc, char *argv[])
         [gl_cv_func_ilogbl_works=yes],
         [gl_cv_func_ilogbl_works=no],
         [case "$host_os" in
-           haiku*) gl_cv_func_ilogbl_works="guessing no" ;;
+           aix* | haiku*)
+                   gl_cv_func_ilogbl_works="guessing no" ;;
                    # Guess yes on native Windows.
            mingw*) gl_cv_func_ilogbl_works="guessing yes" ;;
            *)      gl_cv_func_ilogbl_works="guessing yes" ;;