[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
frexpl: detect BeOS bug
From: |
Bruno Haible |
Subject: |
frexpl: detect BeOS bug |
Date: |
Sun, 20 May 2007 12:25:37 +0200 |
User-agent: |
KMail/1.5.4 |
The BeOS frexpl() function is broken: it does not work for x = 2^(i-1)
where LDBL_MAX_EXP-62 <= i <= LDBL_MAX_EXP. This detects it, so that
gnulib's frexpl() substitute is used instead.
2007-05-20 Bruno Haible <address@hidden>
* m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Add test for large finite
numbers that fails on BeOS.
* doc/functions/frexpl.texi: Update.
*** doc/functions/frexpl.texi 1 May 2007 17:59:19 -0000 1.2
--- doc/functions/frexpl.texi 20 May 2007 09:57:40 -0000
***************
*** 13,19 ****
FreeBSD 5.2.1, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9,
Cygwin, Interix 3.5.
@item
This function does not work on finite numbers on some platforms:
! AIX 5.1.
@item
This function does not work on infinite numbers on some platforms:
IRIX 6.5.
--- 13,19 ----
FreeBSD 5.2.1, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9,
Cygwin, Interix 3.5.
@item
This function does not work on finite numbers on some platforms:
! AIX 5.1, BeOS.
@item
This function does not work on infinite numbers on some platforms:
IRIX 6.5.
*** m4/frexpl.m4 20 May 2007 08:19:54 -0000 1.9
--- m4/frexpl.m4 20 May 2007 09:57:41 -0000
***************
*** 1,4 ****
! # frexpl.m4 serial 4
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # frexpl.m4 serial 5
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
***************
*** 95,102 ****
fi
])
! dnl Test whether frexpl() works on finite numbers (this fails on AIX 5.1) and
! dnl also on infinite numbers (this fails e.g. on IRIX 6.5).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
--- 95,102 ----
fi
])
! dnl Test whether frexpl() works on finite numbers (this fails on AIX 5.1 and
! dnl on BeOS) and also on infinite numbers (this fails e.g. on IRIX 6.5).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
***************
*** 117,122 ****
--- 117,136 ----
if (exp != 5)
return 1;
}
+ /* Test on large finite numbers. This fails on BeOS at i = 16322, while
+ LDBL_MAX_EXP = 16384.
+ In the loop end test, we test x against Infinity, rather than comparing
+ i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
+ {
+ int i;
+ for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
+ {
+ int exp = -9999;
+ frexpl (x, &exp);
+ if (exp != i)
+ return 1;
+ }
+ }
/* Test on infinite numbers. */
x = 1.0L / 0.0L;
{
***************
*** 128,135 ****
return 0;
}], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no],
[case "$host_os" in
! aix* | irix*) gl_cv_func_frexpl_works="guessing no";;
! *) gl_cv_func_frexpl_works="guessing yes";;
esac
])
])
--- 142,149 ----
return 0;
}], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no],
[case "$host_os" in
! aix* | beos* | irix*) gl_cv_func_frexpl_works="guessing no";;
! *) gl_cv_func_frexpl_works="guessing yes";;
esac
])
])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- frexpl: detect BeOS bug,
Bruno Haible <=