Hello,

I just wanted to find out the status of bug 43053 
(http://bugs.php.net/bug.php?id=43053) which is regarding inconsistent 
handling of floating point numbers which seems to have changed in PHP 5.2.2 
and later, but I don't see it documented nor see it listed on any changelog 
or announcement.  The problem is that certain floating point numbers are 
being printed in scientific notation while others aren't - for example, 
1200000.00 prints as 1.2E+6 while 1300000.00 prints as 1300000.  In PHP 
5.2.1 and earlier, 1200000.00 printed as 1200000.  This then causes output 
and validation issues since if the 1.2E+6 number is being passed somewhere 
else, sprintf must be wrapped around it (e.g. echo'ed in the script, put in 
a xml document validated against a schema, etc).

While I understand that the way floating point numbers are stored can vary 
and shouldn't be relied upon, I'm more curious why a change was made in PHP 
5.2.2 to print certain numbers in scientific notation, as it makes working 
with floating point numbers much more difficult in PHP - in all previous 
versions of PHP, these numbers were printed out in full form, not in 
scientific notation.

Appreciate any help or feedback you could provide-

Thanks,
Ryan



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to