On 7/20/2013 23:43, K. Frank wrote:
> Hello List!
> 
> On 64-bit mingw-w64:
> 
>    g++ (rubenvb-4.8-stdthread) 4.8.1 20130324 (prerelease)
> 
> on 64-bit windows 7, I'm seeing that long doubles have a precision of about
> 18 decimal digits.  I would guess that this is a legacy of the old 8087 80-bit
> internal floating-point number.
> 
>>From a quick test program (no explicit compiler flags):
> 
>    numeric_limits<float>::digits10 = 6
>    numeric_limits<double>::digits10 = 15
>    numeric_limits<long double>::digits10 = 18
> 
>    numeric_limits<float>::max_digits10 = 9
>    numeric_limits<double>::max_digits10 = 17
>    numeric_limits<long double>::max_digits10 = 21
> 
>    sizeof(float) = 4
>    sizeof(double) = 8
>    sizeof(long double) = 16
> 
> As you can see, long double offers only a modest increase in precision over
> double, but takes fully twice the space.
> 
> Also, Intel's old 80-bit floating-point format fits in five 16-bit
> words (which fits in
> three 32-bit words).  I am guessing that alignment issues on a 64-bit machine
> make it not worth the bother to use less than a full two 64-bit words to hold 
> a
> long double, even though (if I'm right about the 80-bit
> representation), there's a
> fair amount of wasted space.
> 
> Does this all sound right?

on a 64-bit machine, floating point goes on SSE registers, which support
2x64-bit floats (128-bit per xmm reg). On a 32-bit machine, it goes on
the 80-bit x87 fpu.

Use something like MPFR if you want arbitrary high precision math
independent of hardware capabilities.


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to