lua-users home
lua-l archive

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



On Jun 26, 2015, at 10:28 AM, James Chang <jcchang92@gmail.com> wrote:



On Fri, Jun 26, 2015 at 10:17 AM, Coda Highland <chighland@gmail.com> wrote:
>
> -- James

I feel reasonably certain that this is exactly the conclusion that
this test is supposed to draw. Why would you expect more?

/s/ Adam

P.S. Don't top-post; put your comments at the bottom of your e-mail replies.

 
Just wondering what you could conclude if it fails besides the obvious. Probably "implementation of numbers looks different, but I think it'll be ok".

-- James

A test like this is typically meant to stop people abusing things. Let’s say someone implemented Lua on a particular CPU that used 80-bit integers, and, by chance, Lua ended up working up to 2^80-1 on that platform (I’m not saying it will .. just assuming that it was written like this and DIDNT test for this). The temptation then exists to use that wider range (perhaps not intentionally, but as a side-effect of some intermediate value in a calculation). Later, the Lua code is run on a regular 64-bit platform and explodes. Finger-pointing ensues .. “Lua is supposed to be portable! Why didn’t Lua warn me?” etc etc.

—Tim