[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: problem with formatting large integers
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 16 Apr 2011 11:23:21 -0300
> Umm ... what does "%i.4" do?
man sprintf
> There's hardly a genuine situation in which
>
> string.format( "%i", 2^31 ) --> -2147483648
>
> is a reasonable or desirable outcome?
Lua (as everything else) is a tradeoff between several conflicting
goals. I do not think this problem is worth the complexity of its
fix. If you want %.0f when you write "%i", write "%.0f".
-- Roberto