aboutsummaryrefslogtreecommitdiff
path: root/lapi.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-23 12:46:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-23 12:46:33 -0300
commit7f5c31cdcac5388b3c48a26112dfb6d2cadb7321 (patch)
tree91012526a941414f1d09e5640d34bee5ccfd240f /lapi.h
parent9e6807c3c9d5036e999f636f936df07b72284442 (diff)
downloadlua-7f5c31cdcac5388b3c48a26112dfb6d2cadb7321.tar.gz
lua-7f5c31cdcac5388b3c48a26112dfb6d2cadb7321.tar.bz2
lua-7f5c31cdcac5388b3c48a26112dfb6d2cadb7321.zip
Fixed bug in 'string.format' with option '%f'
As an example, 'print(string.format("%.99f", 1e70))' may have a lot of garbage after the number. The old test to ensure that 'string.format("%.99f", n)' was not too large, 'fabs(n) < 1e100', assumes that the number will fit in the 99 bytes; but the 99 is not the space for the number, it is the added extra zeros. The option worked for smaller numbers because of the extra space added to MAX_ITEM.
Diffstat (limited to 'lapi.h')
0 files changed, 0 insertions, 0 deletions