[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: problem with string.format %d and very large integers
- From: Florian Weimer <fw@...>
- Date: Thu, 28 Jul 2011 11:27:07 +0200
* Xavier Wang:
> 2011/7/28 Florian Weimer <fw@deneb.enyo.de>:
>> * Norman Ramsey:
>>
>>> The first law holds, but if n is sufficiently large, the second does not:
>>>
>>> : nr@labrador 12309 ; lua
>>> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
>>
>> Whay kind of architecture do you use? It works for me as expcted with
>> Lua 5.1.4 on Debian squeeze amd64.
> Obviously he is on a 32x machine :) -2147483648 == -2^32
Not so obvious. %d expects an int argument, which is 32 bit on amd64,
too. Perhaps the C varargs calling convention is fixing things up on
amd64, but I'm not sure.