PHP 4.0 Bug #9292 Updated: Odd behavior adding negative numbers.
| From: | jdj at darkside dot dynup dot net | Date: | Fri, 16 Feb 2001 02:30:34 +0000 |
| Subject: | PHP 4.0 Bug #9292 Updated: Odd behavior adding negative numbers. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46717@lists.php.net to get a copy of this message | ||
ID: 9292
User Update by: jdj@darkside.dynup.net
Old-Status: Open
Status: Closed
Bug Type: Math related
Description: Odd behavior adding negative numbers.
Nevermind.. it's just the nature of the beast ;)
Previous Comments:
---------------------------------------------------------------------------
[2001-02-15 21:10:33] jdj@darkside.dynup.net
Ok guys.. I've looked everywhere and cannot find an explanation
for this behavior. Could you guys explain it? :)
This script returns the same thing on 4.0.4p1 and 4.0.3p1.
/* Anything less than 3.2/-0.32 exhibits this behavior. Anything above it doesn't */
$x = 0.1 * 3.2;
$y = -0.32;
print("$xt$ynn");
$a = $x - $y;
$b = $x + $y;
print("$at$bn");
I can increase the 3.2 and the -0.32 and the return is sane.. everything I've tried below 3.2
returns this oddity.
Output from above script..
0.32 -0.32
0.64 5.5511151231258E-17
Any clues?
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=9292