roundf-ieee: Fix test failures on AIX 7.1 and OSF/1 5.1.
authorBruno Haible <bruno@clisp.org>
Sun, 19 Jun 2011 12:06:51 +0000 (14:06 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 19 Jun 2011 12:06:51 +0000 (14:06 +0200)
* m4/roundf.m4 (gl_FUNC_ROUNDF): Test also the sign of roundf (-0.3f).
* modules/roundf-ieee (Depends-on): Add floorf-ieee, ceilf-ieee.
* doc/posix-functions/roundf.texi: Mention problem with negative
arguments.
* doc/posix-functions/ceilf.texi: Mention problem on OSF/1 5.1.

ChangeLog
doc/posix-functions/ceilf.texi
doc/posix-functions/roundf.texi
m4/roundf.m4
modules/roundf-ieee

index 698473f..74dd189 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-06-19  Bruno Haible  <bruno@clisp.org>
 
+       roundf-ieee: Fix test failures on AIX 7.1 and OSF/1 5.1.
+       * m4/roundf.m4 (gl_FUNC_ROUNDF): Test also the sign of roundf (-0.3f).
+       * modules/roundf-ieee (Depends-on): Add floorf-ieee, ceilf-ieee.
+       * doc/posix-functions/roundf.texi: Mention problem with negative
+       arguments.
+       * doc/posix-functions/ceilf.texi: Mention problem on OSF/1 5.1.
+
+2011-06-19  Bruno Haible  <bruno@clisp.org>
+
        ceilf-ieee: Work around bug on MacOS X 10.5.
        * doc/posix-functions/ceilf.texi: Mention the MacOS X 10.5 problem.
 
index f9c0394..890b979 100644 (file)
@@ -18,7 +18,7 @@ Portability problems fixed by Gnulib module @code{ceilf-ieee}:
 @item
 This function returns a positive zero for an argument between -1 and 0
 on some platforms:
-MacOS X 10.5, AIX 7.1.
+MacOS X 10.5, AIX 7.1, OSF/1 5.1.
 @item
 This function returns a positive zero for a minus zero argument
 on some platforms:
index c4fb602..b1d854b 100644 (file)
@@ -22,6 +22,10 @@ mingw.
 Portability problems fixed by Gnulib module @code{roundf-ieee}:
 @itemize
 @item
+This function returns a positive zero for an argument between -0.5 and 0
+on some platforms:
+AIX 7.1, OSF/1 5.1.
+@item
 This function returns a positive zero for a minus zero argument
 on some platforms:
 OSF/1 5.1.
index 83dffd1..9c21340 100644 (file)
@@ -1,4 +1,4 @@
-# roundf.m4 serial 12
+# roundf.m4 serial 13
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -70,10 +70,14 @@ static float dummy (float f) { return 0; }
 int main (int argc, char *argv[])
 {
   float (*my_roundf) (float) = argc ? roundf : dummy;
+  int result = 0;
   /* Test whether roundf (-0.0f) is -0.0f.  */
   if (signbitf (minus_zerof) && !signbitf (my_roundf (minus_zerof)))
-    return 1;
-  return 0;
+    result |= 1;
+  /* Test whether roundf (-0.3f) is -0.0f.  */
+  if (signbitf (-0.3f) && !signbitf (my_roundf (-0.3f)))
+    result |= 2;
+  return result;
 }
               ]])],
               [gl_cv_func_roundf_ieee=yes],
index ffa2381..6496cc3 100644 (file)
@@ -8,6 +8,8 @@ m4/signbit.m4
 
 Depends-on:
 roundf
+floorf-ieee     [test $HAVE_DECL_ROUNDF = 0 || test $REPLACE_ROUNDF = 1]
+ceilf-ieee      [test $HAVE_DECL_ROUNDF = 0 || test $REPLACE_ROUNDF = 1]
 
 configure.ac:
 gl_FUNC_ROUNDF_IEEE