lua-users home
lua-l archive

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


On 07/07/2013 20:36, Roberto Ierusalimschy wrote:
Not at all. If you are using 64-bit integers, the printing is wrong;
'a' should be 1311768467750125276. Can you try this?

= a .. ''
= string.format("%d", a)
= string.format("%x", a)
io.write(a, "\n")

Lua 5.3.0 (work1)  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> a = 0x12345678abcdfedc
> = a
-1412563236
> = a .. ''
-1412563236
> = string.format("%d", a)
-1412563236
> = string.format("%x", a)
abcdfedc
> io.write(a, "\n")
-1412563236

Then I changed from Windows XP x86 to Windows 7 x64, ran these tests with the same binaries and the results were correct.

It seems that msvcrt.dll on these two systems behave differently.

--
Shmuel