Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36123 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85935 invoked from network); 13 Mar 2008 16:56:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2008 16:56:28 -0000 X-Host-Fingerprint: 216.91.31.189 unknown Received: from [216.91.31.189] ([216.91.31.189:15063] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/42-34038-44059D74 for ; Thu, 13 Mar 2008 11:03:16 -0500 Message-ID: <2F.42.34038.44059D74@pb1.pair.com> To: internals@lists.php.net Date: Thu, 13 Mar 2008 12:03:00 -0400 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-Posted-By: 216.91.31.189 Subject: bug 43053 - scientific notation From: rbro@hotmail.com ("Ryan Brothers") 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