#27685 [NEW]: floating point?
| From: | ymlee at ibcenter dot co dot kr | Date: | Thu, 25 Mar 2004 00:12:52 +0000 |
| Subject: | #27685 [NEW]: floating point? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-56784@lists.php.net to get a copy of this message | ||
From: ymlee at ibcenter dot co dot kr
Operating system: linux
PHP version: 4.3.4
PHP Bug Type: *General Issues
Bug description: floating point?
Description:
------------
$a=33.6;
$b=84.7;
$c=118.3;
$d=$a+$b-$c;
echo $d;
the answer should 0.
but result is 1.4210854715202E-14.
it is strange!!!
Reproduce code:
---------------
$a=33.6;
$b=84.7;
$c=118.3;
$d=$a+$b-$c;
echo $d;
Expected result:
----------------
0
Actual result:
--------------
1.4210854715202E-14
--
Edit bug report at http://bugs.php.net/?id=27685&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27685&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27685&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27685&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27685&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27685&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27685&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27685&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27685&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27685&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27685&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27685&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27685&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27685&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27685&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27685&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27685&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27685&r=float