Hi Bruno, On 4 Jun 2007, at 12:42, Bruno Haible wrote:
Gary V. Vaughan wrote:Run till exit from #0 my_ldexp (x=1.0121050218045312617883299999606451e-292, d=969) at test- printf- frexpl.c:56This value x has the mantissa 0x2.051EB851EB8520000000000000. Whichmeans, the hardware truncates the precision when converting a number fromnormalized to denormalized range. Can you try this patch, please? (Not yet committed in CVS.) *** tests/test-printf-frexpl.c 29 Apr 2007 09:15:13 -0000 1.4 --- tests/test-printf-frexpl.c 4 Jun 2007 11:41:57 -0000 *************** *** 39,49 **** while (0)/* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable ! exponent for 'long double' is -964. For exponents below that, the ! precision may be truncated to the precision used for 'double'. */#ifdef __sgi # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57) # define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP #else # define MIN_NORMAL_EXP LDBL_MIN_EXP # define MIN_SUBNORMAL_EXP (LDBL_MIN_EXP - 100) --- 39,54 ---- while (0)/* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable ! exponent for 'long double' is -964. Similarly, on PowerPC machines, ! LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' ! is -968. For exponents below that, the precision may be truncated to the! precision used for 'double'. */ #ifdef __sgi # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57) # define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP+ #elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__+ # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) + # define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP #else # define MIN_NORMAL_EXP LDBL_MIN_EXP # define MIN_SUBNORMAL_EXP (LDBL_MIN_EXP - 100)
That fixes test-frexpl.c on my ppc machine.
*** tests/test-frexpl.c 29 Apr 2007 09:15:13 -0000 1.6 --- tests/test-frexpl.c 4 Jun 2007 11:41:57 -0000 *************** *** 40,49 **** while (0)/* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable ! exponent for 'long double' is -964. For exponents below that, the ! precision may be truncated to the precision used for 'double'. */#ifdef __sgi # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57) #else # define MIN_NORMAL_EXP LDBL_MIN_EXP #endif --- 40,53 ---- while (0)/* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable ! exponent for 'long double' is -964. Similarly, on PowerPC machines, ! LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' ! is -968. For exponents below that, the precision may be truncated to the! precision used for 'double'. */ #ifdef __sgi # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57)+ #elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__+ # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) #else # define MIN_NORMAL_EXP LDBL_MIN_EXP #endif
This doesn't have chance to come into play, as the loop aborts in an assertion
failure on the first iteration:
(gdb) run
Starting program: /Users/gary/m4-1.4.9b/tests/test-frexpl
Breakpoint 1, main () at test-frexpl.c:160
160 for (i = 1, x = 1.01L; i <= LDBL_MAX_EXP; i++, x *= 2.0L)
(gdb) n
162 int exp = -9999;
(gdb)
163 long double mantissa = frexpl (x, &exp);
(gdb)
164 ASSERT (exp == i);
(gdb)
165 ASSERT (mantissa == 0.505L);
(gdb) p mantissa
$1 = 0.50499999999999989341858963598497212
(gdb) p exp
$2 = 1
(gdb) p i
$3 = 1
(gdb) p x
$4 = 1.0100000000000000088817841970012523
(gdb) n
test-frexpl.c:165: assertion failed
Program received signal SIGABRT, Aborted.
0x9004822c in kill ()
Cheers,
Gary
--
())_. Email me: [EMAIL PROTECTED]
( '/ Read my blog: http://blog.azazil.net
/ )= ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912
PGP.sig
Description: This is a digitally signed message part
