[PHP-BUG] Bug #66132 [NEW]: X*5/X where X is floating point number is greater than 5

[email protected] ("utilmind at gmail dot com") Wed, 20 Nov 2013 23:53:46 GMT
Newsgroups php.gtk.dev
Message-ID <[email protected]>
From:             utilmind at gmail dot com
Operating system: Any, tested in Win32 and CentOS
PHP version:      5.4.22
Package:          PHP-GTK related
Bug Type:         Bug
Bug description:X*5/X where X is floating point number is greater than 5

Description:
------------
It's probably bug with conversion from floating point number, or bug
with comparision between types. We know that X*5/5 is 5. Even PHP
returns 5, however, sometimes, returned value appears to be greater than
5.

Test script:
---------------
$n = (3.89880952381*5/3.89880952381); // result will be exactly 5
print $n.'!=5 ? '.($n>5); // here it appears that 5 is greater than 5


-- 
Edit bug report at https://bugs.php.net/bug.php?id=66132&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66132&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66132&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66132&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66132&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66132&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66132&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66132&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66132&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66132&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66132&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66132&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66132&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66132&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66132&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66132&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66132&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66132&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66132&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66132&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66132&r=mysqlcfg