This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libm-test.inc: Correctly implement ulp().
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Andreas Jaeger <aj at suse dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 27 May 2013 13:31:16 -0400
- Subject: Re: [PATCH] libm-test.inc: Correctly implement ulp().
- References: <5195593A dot 7090202 at redhat dot com> <51968072 dot 2090606 at suse dot com> <51968291 dot 2010707 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1305172033500 dot 19066 at digraph dot polyomino dot org dot uk> <519FB011 dot 8080204 at redhat dot com> <m2vc665btz dot fsf at linux-m68k dot org>
On 05/26/2013 05:28 AM, Andreas Schwab wrote:
> "Carlos O'Donell" <carlos@redhat.com> writes:
>
>> + /* The next closest subnormal value is a constant distance away. */
>> + ulp = FUNC(ldexp) (1.0, 1 - (MAX_EXP + MANT_DIG));
>
> This is wrong for IBM long double. The smallest representable value is
> 2^-1074, not 2^-1127.
I'm looking into this ASAP. Getting a Power64 box to test on.
I simply expected the values of MAX_EXP and MANT_DIG for IBM long double
to be such that the equation would just work.
Cheers,
Carlos.