From: ribarra at innox dot com dot mx
Operating system: Linux Mandrake 9.2
PHP version: 4.3.4
PHP Bug Type: *Math Functions
Bug description: intval changes value on one particular number
Description:
------------
The following code should output exactly the same number in both echo
cases but it doesn't. However, multiply the number by 1000 instead of the
100 on the first line and everything will work fine.
Reproduce code:
---------------
<?php
$test = (642 + 0.56) * 100;
echo $test . "\n";
$test = intval ($test);
echo $test;
?>
Expected result:
----------------
64256
64256
Actual result:
--------------
64256
64255
Very weird, I have only seen it happen with this particular case.
--
Edit bug report at http://bugs.php.net/?id=27199&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27199&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27199&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27199&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27199&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27199&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27199&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27199&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27199&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27199&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27199&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27199&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27199&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27199&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27199&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27199&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27199&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27199&r=float