From: JaiKMw at aol dot com
Operating system: WinME
PHP version: 4.3.4
PHP Bug Type: Unknown/Other Function
Bug description: Arithmetic Error with JS and PHP
Description:
------------
/* I would like to know if this
is a bug, cuz i konw of some
issues of defective processors
like my pentium II processor
I don't think that, cuz in
the calculator of WinME the
Answer is Right (23+23/2=23)
This also happens with JavaScript... :-| :D
Reproduce code:
---------------
<?php
function Mm($a,$b){
$R=$a+$b*0.5;// Is The Same If I Put " /2 " Instead.
return $R;
}
echo Mm(23,23)."<BR>";//The Correct Would Be 23 Instead of 34.5
echo Mm(243,456)."<BR>";//'''''''''''''''''' 349.5 Instead of 471.
?>
Expected result:
----------------
To write the Correct Answers..
Actual result:
--------------
Doesn't givethe right Answer, and, it seems so stupid :D.. with all the
respect :P, cuz 23+23=46, but, javascript do the same too, is an error on
my processor or not?, the calc.exe shows the right answer.. :D... That
bugs are from year 2000 xD.. :D
--
Edit bug report at http://bugs.php.net/?id=26366&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26366&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26366&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26366&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26366&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26366&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26366&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26366&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26366&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26366&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26366&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26366&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26366&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26366&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26366&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26366&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26366&r=float