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 - Fix tests to work with CLI 2002-03-05 09:00:56 +00:00
bug21523.phpt Fix Bug #21523 - number_format could cause a memory allocation for a 2003-01-09 15:44:49 +00:00
floorceil.phpt Removed the ceil(-0.5); test. The return value is depedant on system's 2002-09-29 21:45:54 +00:00
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 Added tests for pow()'ing with broken exponents and some additional test 2002-03-21 14:18:30 +00:00
round.phpt - Fix tests to work with CLI 2002-03-05 09:00:56 +00:00