php-src/ext/standard/tests/math
Wez Furlong d8fbd1acef Fix Bug #21523 - number_format could cause a memory allocation for a
negative memory size in situations where the sprintf implementation of the
host system generated less decimal places than were requested.

Resolved this issue by making number_format examine the string returned
by spprintf and have it pad to the correct number of decimal places.

Added a test-case based on the bug report; the length of decimal places
required to trigger this bug is sprintf implementation dependent; as the
implementation is now using spprintf (provided by PHP), that number is
78 digits (NDIG - 2).

# I played with the idea of enhancing sprintf to do the equivalent, but
# it was too much effort considering that the precision of floats/doubles
# is not good enough to warrant it.

# This fix could do with some QA from someone else to make sure there are
# no memory bounds problems and then MFH it to PHP_4_3
2003-01-09 15:44:49 +00:00
..
abs.phpt
bug21523.phpt Fix Bug #21523 - number_format could cause a memory allocation for a 2003-01-09 15:44:49 +00:00
floorceil.phpt
hexdec.phpt Conversion fix by Michael Mauch 2002-11-17 09:27:48 +00:00
log.phpt Add the ability to take the logarithm of any base by adding a base parameter 2002-11-11 05:21:35 +00:00
pow.phpt
round.phpt