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
|