bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils 6.9.92 fail to configure on *bsd


From: Bruno Haible
Subject: Re: coreutils 6.9.92 fail to configure on *bsd
Date: Mon, 14 Jan 2008 02:41:11 +0100
User-agent: KMail/1.5.4

Hello Elias,

> > Please also show the contents of <float.h> (in /usr/include, I assume)
> 
> I've attached float.h
> ...
>   % gcc -Ilib buz.c
>   % ./a.out        
>   LDBL_MANT_DIG = 64
>   LDBL_DIG = 18
>   LDBL_MIN_EXP = -16381
>   LDBL_MAX_EXP = 16384
>   LDBL_MIN_10_EXP = -4931
>   LDBL_MAX_10_EXP = 4932
>   sizeof (long double) = 16
>   LDBL_EXPBIT0_WORD = 2
>   LDBL_EXPBIT0_BIT = 0

Thanks, that's as it should be for i386 'long double's. That's correct.

> > OK, test-frexpl.c:137 and test-printf-frexpl.c:96. Then what's the value of 
> > 'i'
> > at the moment when it fails?
>
> I've attached two patches to illustrate what I did. 
> 
> They both yield "i == -16382".

Thanks. So it's a problem with denormalized numbers. Can you please try
this program (link against nothing, just libc)?

========================== foo.c ========================
#include <float.h>
#include <math.h>
extern long double frexpl (long double, int *);
#include <stdio.h>
int main()
{
  int i;
  volatile long double x;
  /* Test on denormalized numbers.  */
  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 IEEE754 arithmetic: x = 1.68105e-4932, exp = -16382.
         On MacOS X 10.5: ??. Correct: y = 0.5.  */
      printf ("%d %g\n", exp, (double) y);
      if (y != 0.5L)
        return 1;
    }
  return 0;
}
===========================================================

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]