lua-users home
lua-l archive

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


> On Jun 1, 2015, at 6:29 AM, Coda Highland <chighland@gmail.com> wrote:
> 
> On Mon, Jun 1, 2015 at 6:26 AM, Coda Highland <chighland@gmail.com> wrote:
>> On Mon, Jun 1, 2015 at 3:06 AM, Tim Hill <drtimhill@gmail.com> wrote:
>>> This also takes care
>>> of the issue of FP errors, since all the math is now done on integers.
> 
> Also, it doesn't resolve FP errors in Lua 5.1/5.2, because numbers are
> still double-precision floats and not true integers. The act of adding
> 1 + 1<<53 is what causes the problem, not dealing with fractional
> values.
> 
> /s/ Adam
> 

True. To be honest I was assuming a “production” version would be coded in C, which could use a 128-bit counter/summer (rolled manually if needed) and therefore avoids both the 5.2/5.3 issue and the overflow issue you noted.

—Tim