ID:               47774
 Updated by:       matt...@php.net
 Reported By:      vivekanandan8 at yahoo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Debian
 PHP Version:      5.2CVS-2009-03-25 (snap)
 New Comment:

This is the expected behavior. Happens because it's not parsed as a
single negative number, but a positive number (and 2147483648 needs to
be a float) that is then negated afterwards. So it's treated more like
-(2147483648). Hope that helps explain what's going on. :-)


Previous Comments:
------------------------------------------------------------------------

[2009-03-25 14:28:33] vivekanandan8 at yahoo dot com

Description:
------------
Generally when integer number exceed(overflows), it is converted to
float,But for the number -2147483648 the Integer can hold, but converted
to float.   

Reproduce code:
---------------
<?
$vValue =       (int)-2147483648;
var_dump($vValue);
$vValue = -2147483648;
var_dump($vValue);
?>

Expected result:
----------------
int(-2147483648) int(-2147483648) 

Actual result:
--------------
int(-2147483648) float(-2147483648) 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47774&edit=1

Reply via email to