lua-users home
lua-l archive

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


On Nov 21, 2012, at 10:40 AM, Roberto Ierusalimschy wrote:

>> If overflow raises an error, any computation completing without error
>> will be identical to an all-float version. I think.
> 
> Not exactly, because a computation can "overflow" with floats and
> not overflow with 64-bit integers. ("overflow" here means lose of
> precision.) 

Aha--I had assumed (without much basis) that integers were 32-bit.

More exactly, I assumed the integers were precisely represented in floating point. It becomes difficult to talk about the length of anything in portable C, of course. For many purposes, 32-bit precise integers really are enough but that is a value judgment.

There are 80- and 128-bit floating point formats on modern x86 CPUs, including in the x32 ABI, but I'm not sure that's relevant.