This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] BZ#15536: Fix ulp(0x0.0p0) for 128-bit IBM long double.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Andreas Schwab <schwab at suse dot de>, Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Date: Fri, 31 May 2013 17:12:13 +0000
- Subject: Re: [PATCH] BZ#15536: Fix ulp(0x0.0p0) for 128-bit IBM long double.
- References: <51A84400 dot 80005 at redhat dot com>
On Fri, 31 May 2013, Carlos O'Donell wrote:
> +#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106
> + /* In 128-bit IBM long double the precision of the type degenerates
> + to double when we use subnormals. */
> + ulp = FUNC(ldexp) (1.0, 1 - (MAX_EXP + (__DBL_MANT_DIG__ - 1)));
> +#else
> ulp = FUNC(ldexp) (1.0, 1 - (MAX_EXP + MANT_DIG));
> +#endif
Rather than having such a conditional at all, I think you should define
things in terms of MIN_EXP and MANT_DIG, where a single piece of logic
should give 0x1p-1074 for both double and IBM long double.
--
Joseph S. Myers
joseph@codesourcery.com