[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Large number bytecode weirdness on different platforms
- From: Mike Pall <mikelu-0701@...>
- Date: Mon, 29 Jan 2007 23:12:47 +0100
> I'll look into the 0x parsing and see what the issue is.
MSVCRT is (still) not C99 compliant and cannot parse hex
floating-point numbers with strtod(). So the fallback with
strtoul() kicks in and (obviously) fails for hex numbers which do
not fit into a long (32 bit on WIN32). Complain to M$.
Since strtod() from glibc is C99-compliant, the problem does not
arise on Linux (and most other OS). I.e you get hex numbers with
full FP number precision.
The behaviour of number parsing and output is system dependent
because Lua uses the library functions provided by the toolchain.
This makes sense because some implementations need more lines of
code for this task than Lua itself. ;-)