From 24c9b888b26b84689b5da9558b6899e4b004a560 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Jun 2011 14:06:51 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ doc/posix-functions/ceilf.texi | 2 +- doc/posix-functions/roundf.texi | 4 ++++ m4/roundf.m4 | 10 +++++++--- modules/roundf-ieee | 2 ++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 698473f0a..74dd189df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2011-06-19 Bruno Haible + 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 + ceilf-ieee: Work around bug on MacOS X 10.5. * doc/posix-functions/ceilf.texi: Mention the MacOS X 10.5 problem. diff --git a/doc/posix-functions/ceilf.texi b/doc/posix-functions/ceilf.texi index f9c0394eb..890b979b2 100644 --- a/doc/posix-functions/ceilf.texi +++ b/doc/posix-functions/ceilf.texi @@ -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: diff --git a/doc/posix-functions/roundf.texi b/doc/posix-functions/roundf.texi index c4fb60291..b1d854b90 100644 --- a/doc/posix-functions/roundf.texi +++ b/doc/posix-functions/roundf.texi @@ -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. diff --git a/m4/roundf.m4 b/m4/roundf.m4 index 83dffd1a8..9c21340ca 100644 --- a/m4/roundf.m4 +++ b/m4/roundf.m4 @@ -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], diff --git a/modules/roundf-ieee b/modules/roundf-ieee index ffa2381cd..6496cc387 100644 --- a/modules/roundf-ieee +++ b/modules/roundf-ieee @@ -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 -- 2.11.0