#44890 [Opn]: converting some doubles to strings yields trailing colon
| From: | kalle@php.net | Date: | Tue, 06 May 2008 11:15:58 +0000 |
| Subject: | #44890 [Opn]: converting some doubles to strings yields trailing colon | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-124747@lists.php.net to get a copy of this message | ||
ID: 44890
Updated by: kalle@php.net
Reported By: mr-russ at pws dot com dot au
Status: Open
Bug Type: *General Issues
Operating System: Ubuntu Linux 8.04
PHP Version: 5.2CVS-2008-05-02 (snap)
New Comment:
Im not able to reproduce this on Windows (XP SP2) using an i386
processor.
Have you tried to reproduce this on other systems to check that its not
a bug related to your current OS?
Previous Comments:
------------------------------------------------------------------------
[2008-05-02 09:59:55] mr-russ at pws dot com dot au
Description:
------------
I expect any number, divided by 10 times itself, then converted to a
string, to yield "0.1"
In this release, sometimes I get "0.0:" (yes, that's 0.0 with a
trailing colon character)
I have tested on i386 and amd64. amd64 behaves as expected. i386
gives the invalid result.
Original bug report by Brett Kiefer on Ubuntu Launchpad:
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/218891
Reproduce code:
---------------
<?php
for ($d = 0.10; $d < 1; $d = $d + 0.1) print $d * 10 . " " .
($d / ($d * 10)) . "\n";
?>
Expected result:
----------------
1 0.1
2 0.1
3 0.1
4 0.1
5 0.1
6 0.1
7 0.1
8 0.1
9 0.1
10 0.1
Actual result:
--------------
1 0.1
2 0.1
3 0.1
4 0.1
5 0.1
6 0.0:
7 0.0:
8 0.1
9 0.0:
10 0.1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44890&edit=1