lua-users home
lua-l archive

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


On Wed, Nov 28, 2018 at 1:00 AM Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
>
> >>>>> "Dirk" == Dirk Laurie <dirk.laurie@gmail.com> writes:
>
>  Dirk> On my system (Ubuntu 18.04, amd64 processor), the second-last
>  Dirk> assertion fails, but the last one succeeds.
>
> The assert(tostring(-9223372036854775808) == '-9.2233720368548e+018')
> is fragile in that it makes assumptions about the float output format
> that may not be true - e.g. whether the exponent is given as e+018
> or e+18 (which is what I get on freebsd) or e18.

Sorry, I think a better way to test it is:

```
assert(tostring(-9223372036854775808) ~= '-9223372036854775808')
```