+2008-01-15 Bruno Haible <bruno@clisp.org>
+
+ Work around a MacOS X 10.5 bug in frexpl().
+ * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Also check denormalized numbers.
+ * doc/functions/frexpl.texi: Document the bug.
+ Reported by Elias Pipping <pipping@gentoo.org>.
+
2008-01-14 Eric Blake <ebb9@byu.net>
Touch up previous patch.
This function does not work on finite numbers on some platforms:
MacOS X 10.4/PowerPC, AIX 5.1, BeOS.
@item
+This function does not work on denormalized numbers on some platforms:
+MacOS X 10.5/i386.
+@item
This function does not work on infinite numbers on some platforms:
IRIX 6.5, mingw.
@end itemize
-# frexpl.m4 serial 6
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# frexpl.m4 serial 7
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
])
dnl Test whether frexpl() works on finite numbers (this fails on
-dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS) and also on infinite numbers
-dnl (this fails e.g. on IRIX 6.5 and mingw).
+dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
+dnl (this fails on MacOS X 10.5/i386), and also on infinite numbers (this
+dnl fails e.g. on IRIX 6.5 and mingw).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
return 1;
}
}
+ /* Test on denormalized numbers. */
+ {
+ int i;
+ for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
+ ;
+ if (x > 0.0L)
+ {
+ int exp;
+ long double y = frexpl (x, &exp);
+ /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
+ exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */
+ if (exp != LDBL_MIN_EXP - 1)
+ return 1;
+ }
+ }
/* Test on infinite numbers. */
x = 1.0L / 0.0L;
{