lua-users home
lua-l archive

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


On Fri, May 20, 2016 at 3:15 AM, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
delta = abs(float_value - integer_value)
if delta is greater than 10^9, then float is the correct answer,
otherwise integer value is preferred.

The constant 10^9 does not suit for combination of 4-byte floats and 8-byte integers.
This constant should be 10^9 for 32-bit integers and 10^18 for 64-bit integers.