[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: problem with string.format %d and very large integers
- From: Javier Guerra Giraldez <javier@...>
- Date: Thu, 4 Aug 2011 12:21:48 -0500
On Wed, Aug 3, 2011 at 3:38 PM, Norman Ramsey <firstname.lastname@example.org> wrote:
> That's really unfortunate. I liked the story about 'all numbers are
> IEEE doubles', but it sounds like the real story is 'all numbers are
> IEEE doubles, except when they are cast to C ints.' That's not
> nearly as good.
Is see it as:
- "Number represents real (double-precision floating-point) numbers"
(2.2 - Values and Types)
- " The format string follows the same rules as the printf family of
standard C functions." (5.4 - String Manipulation)
- "d, i : The int argument....." (man sprintf)
there, %d means a C int argument, so the LuaNumber is cast to int. in
most builds, that's 32 bit signed. no mysteries, not Lua's fault.