[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 10 Jul 2013 10:18:17 -0300
> On Jul 9, 2013 5:44 PM, "Sean Conner" <sean@conman.org> wrote:
> > > print(2^64)
> > 18446744073709551616
> > > print(2^64+1)
> > 18446744073709551616
>
> Looks like that's not quite perfect. (Also I suspect you made that patch
> backwards.)
This result is correct. On many (all?) Intel CPUs, long double uses
80-bit floats, which have exactly 64 bits in their mantissas. So, they
count correctly up to 2^64, but after that they lose precision. (Because
of alignment, the sizeof of a long double usually is larger than 80
bits.)
-- Roberto
- References:
- [ANN] Lua 5.3.0 (work1) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.3.0 (work1) now available, Ico
- Re: [ANN] Lua 5.3.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work1) now available, Xavier Wang
- Re: [ANN] Lua 5.3.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work1) now available, Tim Hill
- Re: [ANN] Lua 5.3.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work1) now available, Sean Conner
- Re: [ANN] Lua 5.3.0 (work1) now available, Sean Conner
- Re: [ANN] Lua 5.3.0 (work1) now available, Rena