lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> d=          10^308  == -0x8.e679c2f5e45200p+1020 
> d2=  strtod(10^308) == -0x8.e679c2f5e45280p+1020 
> [...]
>       printf( "\nd=          10^308  == %.14a ", d);
> [...]

A small digression: by the C standard, we should not use '.14' with
'%a': "the [default] precision is sufficient for an exact representation
of the value". In correct systems, they even ensure that all bits
presented are significative, by adjusting the number of bits in the
integer part. So, we do not get those extra non-significative zero bits
in '280p+...'. Instead, we get 0x1.1ccf385ebc8ap+1023. However, I am
not sure the Windows libc respects the standard here...

-- Roberto