#44890 [Opn->Bgs]: converting some doubles to strings yields trailing colon
ID: 44890
User updated by: mr-russ at pws dot com dot au
Reported By: mr-russ at pws dot com dot au
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Ubuntu Linux 8.04
PHP Version: 5.2CVS-2008-05-02 (snap)
New Comment:
I am now under the impression it's a bug with my current operating
system. I installed the same snapshot onto an i386 Centos 5.1 box and
did not have any problems with the output.
I should have thought to test on more systems than I did. Sorry for
the noise.
Previous Comments:
------------------------------------------------------------------------
[2008-05-06 11:15:57] kalle@php.net
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?
------------------------------------------------------------------------
[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
Thread (3 messages)