This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] BZ#15536: Fix ulp(0x0.0p0) for 128-bit IBM long double.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]