[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.3 unsigned fall-over?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 24 Mar 2014 07:07:58 +0200
2014-03-23 21:09 GMT+02:00 Andrew Starks <andrew.starks@trms.com>:
> This question comes from ignorance and I'm sincerely curious:
>
> My understanding is that 5.3 internally flips to 64 bit signed when it sees
> that it's out of integer space in the double.
Well, let's test that,
$ lua53
Lua 5.3.0 (work2) Copyright (C) 1994-2014 Lua.org, PUC-Rio
> x=1 -- 64 bit signed
> for k=1,54 do x=2*x+1 end
> x%2
1
> x=1.0 -- double
> for k=1,54 do x=2*x+1 end
> x%2
0.0
So your understanding is wrong.