[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compiler warnings when dealing with huge integers
- From: Martin <eden_martin_fuhrspam@...>
- Date: Wed, 6 Jul 2016 19:58:54 -0700
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