[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Floats and %d
- From: Rena <hyperhacker@...>
- Date: Tue, 14 Jul 2015 20:58:57 -0400
This is something I've been stubbing my toe on a lot lately and it's
Lua 5.3.1 Copyright (C) 1994-2015 Lua.org, PUC-Rio
; print(string.format('%d', 1.1))
stdin:1: bad argument #2 to 'format' (number has no integer representation)
[C]: in function 'string.format'
stdin:1: in main chunk
[C]: in ?
In previous versions - and in C - it would just silently truncate the
number (drop the fractional part). Why was this changed?
Sent from my Game Boy.