summaryrefslogtreecommitdiff
path: root/m4/ilogbl.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-12 12:38:40 +0100
committerBruno Haible <bruno@clisp.org>2019-12-12 12:38:40 +0100
commite5bad6d5201e3e1ad4eb5af82825447591b0fae4 (patch)
tree60494fff554a0ff76da3363e49869d888d244d4e /m4/ilogbl.m4
parentfac670ce47d49a37df8929110b9adc70a1763643 (diff)
downloadgnulib-e5bad6d5201e3e1ad4eb5af82825447591b0fae4.tar.gz
ilogbl: Work around Cygwin bug.
* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Test whether ilogbl(0.0L) is correct. * doc/posix-functions/ilogbl.texi: Mention the Cygwin bug.
Diffstat (limited to 'm4/ilogbl.m4')
-rw-r--r--m4/ilogbl.m411
1 files changed, 9 insertions, 2 deletions
diff --git a/m4/ilogbl.m4 b/m4/ilogbl.m4
index c8ba52a23e..ab274331ca 100644
--- a/m4/ilogbl.m4
+++ b/m4/ilogbl.m4
@@ -1,4 +1,4 @@
-# ilogbl.m4 serial 3
+# ilogbl.m4 serial 4
dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -71,6 +71,7 @@ AC_DEFUN([gl_FUNC_ILOGBL],
])
dnl Test whether ilogbl() works.
+dnl On Cygwin 2.9, ilogb(0.0L) is wrong.
dnl On Haiku 2017, it returns i-2 instead of i-1 for values between
dnl ca. 2^-16444 and ca. 2^-16382.
AC_DEFUN([gl_FUNC_ILOGBL_WORKS],
@@ -108,13 +109,19 @@ int main (int argc, char *argv[])
{
int (* volatile my_ilogbl) (long double) = argc ? ilogbl : dummy;
int result = 0;
+ /* This test fails on Cygwin 2.9. */
+ {
+ x = 0.0L;
+ if (my_ilogbl (x) != FP_ILOGB0)
+ result |= 1;
+ }
/* This test fails on Haiku 2017. */
{
int i;
for (i = 1, x = (long double)1.0; i >= LDBL_MIN_EXP-100 && x > (long double)0.0; i--, x *= (long double)0.5)
if (my_ilogbl (x) != i - 1)
{
- result |= 1;
+ result |= 2;
break;
}
}