printf(long double)

Alexander Motin mav at FreeBSD.org
Thu Apr 22 09:54:11 UTC 2010


Maks Verver wrote:
> On 03/30/10 17:39, Alexander Motin wrote:
>> #include <stdio.h> int main (void) { printf("%Lf %f\n", (long 
>> double)14.5, (double)14.5); return(0); }
>>
>> It compiles cleanly on both arm and amd64, but still not working on 
>> arm: %./a.out 6.500000 14.500000
> 
> I investigated this in detail and it seems to be caused by a bug in the
> __ldtoa function that fails to account for the implicit mantissa bit of
> the double value (6 = 14 - 8) because the ARM port doesn't define
> LDBL_IMPLICIT_NBIT.
> 
> Attached is a patch to lib/libc/arm/_fpmath.h that corrects this
> problem and also corrects the value for LDBL_MANH_SIZE. 

Your patch seems working for me. Thank you!

> Warner, do you
> know if there is a subtle reason why arm/_fpmath.h contains the
> definitions it does now, or are these errors that should be fixed in the
> trunk?

-- 
Alexander Motin


More information about the freebsd-arm mailing list