Re: why 0.1+0.2-0.3~=0
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: why 0.1+0.2-0.3~=0
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: 2012年3月15日 11:03:34 +0100
2012年3月14日 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>> > Does Lua depend on (often poor) native sprintf implementations? or does
>> > it use some variant of David Gay's fp routines?
>>
>> David Gay's dtoa.c is a 86K file with 4356 lines, more than 1/4 of all
>> Lua source code. Moreover, I think it is already in several libc,
>> including glibc.
>
> Moreover, in Lua 5.2, if you want exact string representations for
> doubles, you can (should?) use the hexa format.
Is there an easy way to get back the hexa string representation of a
given number value ?