Re: Number of significand bits in long double?

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Thu, 4 Aug 2005 12:30:30 -0700
On Fri, Aug 05, 2005 at 05:15:47AM +1000, Peter Jeremy wrote:
> On Thu, 2005-Aug-04 09:26:18 -0700, Steve Kargl wrote:
> >Can someone confirm or refute that the long double type
> >has 53 bits in its significand on i386?  Which header 
> >file in /usr/include provides this info?
> 
> A long double on an i386 is 64 bits by default.  The FP initialisation
> code in FreeBSD sets rounding precision to double so that only 53 bits
> are available.  You can override this in userland with fpsetprec() (but
> note this may adversely impact on the accuracy of some libm functions).

fpsetprec is deprecated.  In addition, one finds "... fpsetprec()
functions provide functionality unavailable on many platforms.  At
present, they are implemented only on the i386 and amd64 platforms".

> See the LDBL_* macros in <float.h> for native precision.

That's the problem.  The LDBL* macros misrepresent the
actual precision used.

-- 
Steve
Received on Thu Aug 04 2005 - 17:30:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:40 UTC