From: Bruno Haible Date: Sun, 19 Jun 2011 13:05:39 +0000 (+0200) Subject: roundl-ieee: Fix test failure on AIX 7.1. X-Git-Tag: v0.1~2231 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=42477674eaabe9da1eb5d5d8fc2cca5e2de319a0;p=gnulib.git roundl-ieee: Fix test failure on AIX 7.1. * m4/roundl.m4 (gl_FUNC_ROUNDL): Test also the sign of roundl (-0.3L). * doc/posix-functions/roundl.texi: Mention problem with negative arguments. --- diff --git a/ChangeLog b/ChangeLog index d26cd3708..5db390f44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2011-06-19 Bruno Haible + roundl-ieee: Fix test failure on AIX 7.1. + * m4/roundl.m4 (gl_FUNC_ROUNDL): Test also the sign of roundl (-0.3L). + * doc/posix-functions/roundl.texi: Mention problem with negative + arguments. + +2011-06-19 Bruno Haible + round-ieee: Fix test failures on AIX 7.1 and OSF/1 5.1. * modules/round-ieee (Depends-on): Add floor-ieee, ceil-ieee. * doc/posix-functions/round.texi: Mention problem with negative diff --git a/doc/posix-functions/roundl.texi b/doc/posix-functions/roundl.texi index 5c3be8553..61830c902 100644 --- a/doc/posix-functions/roundl.texi +++ b/doc/posix-functions/roundl.texi @@ -19,6 +19,10 @@ glibc 2.8, OSF/1 5.1. Portability problems fixed by Gnulib module @code{roundl-ieee}: @itemize @item +This function returns a positive zero for an argument between -0.5 and 0 +on some platforms: +AIX 7.1. +@item This function returns a positive zero for a minus zero argument on some platforms: OSF/1 5.1. diff --git a/m4/roundl.m4 b/m4/roundl.m4 index 4f47e3389..9d0d381c7 100644 --- a/m4/roundl.m4 +++ b/m4/roundl.m4 @@ -1,4 +1,4 @@ -# roundl.m4 serial 10 +# roundl.m4 serial 11 dnl Copyright (C) 2007, 2009-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, @@ -35,10 +35,14 @@ static long double dummy (long double f) { return 0; } int main (int argc, char *argv[]) { long double (*my_roundl) (long double) = argc ? roundl : dummy; + int result = 0; /* Test whether roundl (-0.0L) is -0.0L. */ if (signbitl (minus_zerol) && !signbitl (my_roundl (minus_zerol))) - return 1; - return 0; + result |= 1; + /* Test whether roundl (-0.3L) is -0.0L. */ + if (signbitl (-0.3L) && !signbitl (my_roundl (-0.3L))) + result |= 2; + return result; } ]])], [gl_cv_func_roundl_ieee=yes],