Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2010 12:53:54 +0300
From:      Alexander Motin <mav@FreeBSD.org>
To:        Maks Verver <maksverver@geocities.com>
Cc:        freebsd-arm@freebsd.org, Warner Losh <imp@FreeBSD.org>
Subject:   Re: printf(long double)
Message-ID:  <4BD01CB2.6040300@FreeBSD.org>
In-Reply-To: <1271046181.00240326.1271033403@10.7.7.3>
References:  <1269955381.00235504.1269942002@10.7.7.3>	<1269973399.00235672.1269962405@10.7.7.3> <1269976983.00235685.1269964202@10.7.7.3> <1271046181.00240326.1271033403@10.7.7.3>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BD01CB2.6040300>