#30614 [NEW]: Adding floating numbers fails
| From: | mauricio at elmaster dot com | Date: | Fri, 29 Oct 2004 17:21:19 +0000 |
| Subject: | #30614 [NEW]: Adding floating numbers fails | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-68474@lists.php.net to get a copy of this message | ||
From: mauricio at elmaster dot com
Operating system: Linux
PHP version: 5.0.1
PHP Bug Type: Reproducible crash
Bug description: Adding floating numbers fails
Description:
------------
This simple operation fails. We have tried it on PHP 4.3.4 standard
install on fedora Core 2, and PHP 5.0.1.
Instead of 0 we get 1-8.8817841970013E-16. If we change a bit the number
the code doesn't fails, very weird.
Reproduce code:
---------------
<?php
die(9.95 + 4.97 - 9.95 - 4.97);
?>
Expected result:
----------------
0
Actual result:
--------------
1-8.8817841970013E-16
--
Edit bug report at http://bugs.php.net/?id=30614&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30614&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30614&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30614&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30614&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30614&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30614&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30614&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30614&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30614&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30614&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30614&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30614&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30614&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30614&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30614&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30614&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30614&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30614&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30614&r=mysqlcfg