mirror of
https://github.com/lua/lua
synced 2025-02-06 16:24:21 +03:00
Roberto Ierusalimschy
7f5c31cdca
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.
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
Description
No description provided
Languages
C
67.4%
Lua
32%
Makefile
0.6%