#41591 [NEW]: error between limits of types int float
| From: | augustowebd at gmail dot com | Date: | Mon, 04 Jun 2007 19:44:55 +0000 |
| Subject: | #41591 [NEW]: error between limits of types int float | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-113363@lists.php.net to get a copy of this message | ||
From: augustowebd at gmail dot com
Operating system: Windows 2000
PHP version: 5CVS-2007-06-04 (CVS)
PHP Bug Type: SPL related
Bug description: error between limits of types int float
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 bug report at http://bugs.php.net/?id=41591&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41591&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41591&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41591&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41591&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41591&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41591&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41591&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41591&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41591&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41591&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41591&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41591&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41591&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41591&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41591&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41591&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41591&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41591&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41591&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41591&r=mysqlcfg