From:             armadillo at penguinfriends dot org
Operating system: CentOS
PHP version:      5.2.5
PHP Bug Type:     Math related
Bug description:  Error in Floating Point Operation

Description:
------------
The is a bug in many php versions with a floating point operation. Tested
PHP-Versions: 4.4.1 (Debian Sarge (3.1)), 5.0.4 (OpenSuse 10.0 x86_64),
5.2.5 (CentOS 5). It is a conversion from float to int, which doesn't work
correct. See the reprocedure code and the expected result for more.

When running it on the ssh-console on CentOS 5, on the native login
console, the following output will be generated:

setitimer: php (pid = 2731) provided invalid timeval it_value: sec = -1
tv_usec = 0

Hope this will help! ;)

Reproduce code:
---------------
<?php echo (int)(100*2.55); ?>

Expected result:
----------------
255

Actual result:
--------------
254

-- 
Edit bug report at http://bugs.php.net/?id=43267&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43267&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43267&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43267&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43267&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43267&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43267&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43267&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43267&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43267&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43267&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43267&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43267&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43267&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43267&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43267&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43267&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43267&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43267&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43267&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43267&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43267&r=mysqlcfg

Reply via email to