Floating point: just 20 digits of precision

Elias Gabriel Amaral da Silva tolkiendili@gmail.com
Fri Nov 26 16:27:00 GMT 2010


2010/11/26 Marc Glisse <marc.glisse@inria.fr>:
> On Fri, 26 Nov 2010, Elias Gabriel Amaral da Silva wrote:
>
>> Seems to yield the same precision for long double on both ia32 and
>> amd64 - that is, just 20 digits. This seems too few, looking there:
>>
>> http://en.wikipedia.org/wiki/IEEE_754-2008#Basic_formats
>>
>> Shouldn't I expect at least more than 30 digits, on amd64?
>
> long double would be binary80.
>
>> What is the trick for having 1/7 (or something else) with a precision
>> closer to double's 52 digits?
>
> You seem to be confusing binary digits with decimal digits.

Oh, you are right. 20 decimal digits seems to be roughly equivalent to
64 binary digits (20 * log10/log2 is ~66) one would encounter with
80-bits float.

http://en.wikipedia.org/wiki/Extended_precision

Thank you for your reply :)

I'm cc-ing the one that firstly raised this question too



More information about the Gcc-help mailing list