#31548 [Opn]: "1"+"-.1" produce 1
| From: | amonw at hotmail dot com | Date: | Fri, 14 Jan 2005 13:23:58 +0000 |
| Subject: | #31548 [Opn]: "1"+"-.1" produce 1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72155@lists.php.net to get a copy of this message | ||
ID: 31548
User updated by: amonw at hotmail dot com
Reported By: amonw at hotmail dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: redhat linux 9
PHP Version: 4.3.10
New Comment:
Sorry, made a mistake.
Expected result:
----------------
0.9
0.9
Previous Comments:
------------------------------------------------------------------------
[2005-01-14 10:37:55] amonw at hotmail dot com
Description:
------------
An numeric string between -1 and 0 and without a leading zero can't be
converted correctly while php 4.2.2 can.
Reproduce code:
---------------
<?php
print "1"+"-.1";
$a="1";
$b="-.1";
print "\n";
print $a+$b;
?>
Expected result:
----------------
-0.9
-0.9
Actual result:
--------------
1
1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31548&edit=1