lua-users home
lua-l archive

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


On 16-07-06 07:36 AM, Egor Skriptunoff wrote:
> More interesting observation on Lua 5.3.3:
> ; math.floor((-a)/(a-1))
> -1
> ; (-a)//(a-1)
> -2.0
> 
> It was surprising for me to see these expressions have different results.

Cannot reproduce:

    Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
    > local a = 2^53-1 print(math.floor((-a)/(a-1)), (-a) // (a - 1))
    -2	-2.0