#41591 [Opn->Bgs]: error between limits of types int float
| From: | tony2001@php.net | Date: | Mon, 04 Jun 2007 19:52:58 +0000 |
| Subject: | #41591 [Opn->Bgs]: error between limits of types int float | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113364@lists.php.net to get a copy of this message | ||
ID: 41591
Updated by: tony2001@php.net
Reported By: augustowebd at gmail dot com
-Status: Open
+Status: Bogus
-Bug Type: SPL related
+Bug Type: Unknown/Other Function
Operating System: Windows 2000
PHP Version: 5CVS-2007-06-04 (CVS)
New Comment:
Yes, float minus integer is still float and this is expected behavior.
Previous Comments:
------------------------------------------------------------------------
[2007-06-04 19:44:55] augustowebd at gmail dot com
Description:
------------
an improper exchange of types is cause enters the one limits int for
one float. exactly being the same I number, when executed with an
expression the type it is raised for float and when expressed with a
static number the number it remains a whole number.
Reproduce code:
---------------
var_dump( 2147483647 ); // says: int(2147483647)
var_dump( pow(2,31 ) - 1 ); // says: float(2147483647)
Expected result:
----------------
var_dump( 2147483647 ); // int(2147483647)
var_dump( pow(2,31 ) - 1 ); // int(2147483647)
Actual result:
--------------
var_dump( 2147483647 ); // int(2147483647)
var_dump( pow(2,31 ) - 1 ); // int(2147483647)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41591&edit=1