bug-gnulib
[Top][All Lists]
Advanced

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

Re: test-float fails on ppc64 because DBL_MIN_EXP < LDBL_MIN_EXP


From: Jim Meyering
Subject: Re: test-float fails on ppc64 because DBL_MIN_EXP < LDBL_MIN_EXP
Date: Wed, 31 Aug 2011 19:37:43 +0200

Bruno Haible wrote:

> Jim Meyering wrote:
>> I propose to comment out that test for now, just prior
>> to the coreutils-8.13 pre-release snapshot.
>
> But you are not done with commenting out the assertion.
>
> The programs 'printf', 'seq', and 'sort' assume that a 'double' number
> can be losslessly converted to a 'long double'. On platforms where this
> is not the case, you will need to use a
>    union { double d; long double ld; }
> instead of a "long double" value. Otherwise the programs can not read
> and compute with numbers between 1e-307 and 1e-292.

Oh!  Good point.

I haven't looked at the code yet, but suppose this
is a symptom: on ppc64, this fails:

    $ env printf '%.3g\n' 1.33e-300
    printf: 1.33e-300: Numerical result out of range
    1.33e-300
    [Exit 1]

But on my x86_64-based desktop, it works as expected:

    $ env printf '%.3g\n' 1.33e-300
    1.33e-300

However, since this is nothing new, I don't plan
on trying to address it before coreutils-8.13.

There's obviously room (IMHO, a requirement) for new tests.



reply via email to

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