Bug #66132 [Com]: X*5/X where X is floating point number is greater than 5

[email protected] ("[email protected]") Thu, 21 Nov 2013 00:19:36 GMT
Newsgroups php.gtk.dev
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=66132&edit=1

 ID:                 66132
 Comment by:         [email protected]
 Reported by:        utilmind at gmail dot com
 Summary:            X*5/X where X is floating point number is greater
                     than 5
 Status:             Open
 Type:               Bug
 Package:            PHP-GTK related
 Operating System:   Any, tested in Win32 and CentOS
 PHP Version:        5.4.22
 Block user comment: N
 Private report:     N

 New Comment:

This is an PHP main package bug

Confirmed

Version: PHP 5.5.1-2 (built: Aug  5 2013 14:10:28)
OS: Linux version 3.10-2-amd64 #1 SMP Debian 3.10.5-1 (2013-08-07)


Previous Comments:
------------------------------------------------------------------------
[2013-11-20 23:53:46] utilmind at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=66132&edit=1