[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: About big integers in Lua 5.3.
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 13 Jan 2016 06:00:24 +0200
2016-01-13 5:14 GMT+02:00 Xpol Wan <xpolife@gmail.com>:
> When writing a big integer bigger than INT64_MAX, lua 5.3 not correctly
> parsed:
>
> Lua 5.3.1 Copyright (C) 1994-2015 Lua.org, PUC-Rio
>> print(9223372036854775808)
> -9223372036854775808
>
> Is this a bug or limitation?
Neither. It is in fact correct, provided that you understand
twos complement notation.
> math.maxinteger+1
-9223372036854775808
> string.format("%x",math.maxinteger+1)
8000000000000000