#48418 [Com]: NaN > NaN, NaN > 0, NaN < 0 return true
| From: | phplists at stanvassilev dot com | Date: | Thu, 28 May 2009 19:05:20 +0000 |
| Subject: | #48418 [Com]: NaN > NaN, NaN > 0, NaN < 0 return true | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137848@lists.php.net to get a copy of this message | ||
ID: 48418
Comment by: phplists at stanvassilev dot com
Reported By: phplists at stanvassilev dot com
Status: Open
Bug Type: Math related
Operating System: Linux, BSD, possibly all *nix
PHP Version: 5.2.9
New Comment:
And to add a note:
$NaN >= $NaN
$NaN >= 0
$NaN <= 0
These also return true and must return false.
Previous Comments:
------------------------------------------------------------------------
[2009-05-28 18:57:57] phplists at stanvassilev dot com
Description:
------------
Tested on Gentoo, CentOS, OSX.
This is possibly NOT related to the Windows NaN bug, as Windows is NOT
affected by this issue.
However, please test if any fix doesn't cause regression on Windows.
NaN > NaN, NaN > 0, NaN < 0 return true, while they should return false
in all cases (any comparison where either side is NaN, should return
false).
Reproduce code:
---------------
$NaN = sqrt(-1);
var_dump($NaN > $NaN);
var_dump($NaN > 0);
var_dump($NaN < 0);
Expected result:
----------------
float(NAN)
bool(false)
bool(false)
bool(false)
Actual result:
--------------
float(NAN)
bool(true)
bool(true)
bool(true)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48418&edit=1