#32211 [Opn]: Hexadecimal integer value above 32-bit doesn't convert to float
| From: | derick@php.net | Date: | Mon, 07 Mar 2005 07:10:59 +0000 |
| Subject: | #32211 [Opn]: Hexadecimal integer value above 32-bit doesn't convert to float | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969367764@lists.php.net to get a copy of this message | ||
ID: 32211
Updated by: derick@php.net
Reported By: osp at tinet dot org
Status: Open
-Bug Type: Variables related
+Bug Type: Documentation problem
Operating System: Linux and Windows XP
PHP Version: 4.3.10
New Comment:
Documentation is wrong here...
Previous Comments:
------------------------------------------------------------------------
[2005-03-07 02:24:35] osp at tinet dot org
Description:
------------
Hexadecimal values that don't fit a 32-bit size are not converted to
float as specified on documentation:
"Integer overflow
If you specify a number beyond the bounds of the integer type, it will
be interpreted as a float instead."
This works for decimal numbers, but not hexadecimal.
Reproduce code:
---------------
<?php
$myvalue = 0x100000000; // 33-bit value
//$myvalue = 4294967296;
echo $myvalue."<br>";
var_dump( $myvalue );
?>
Expected result:
----------------
4294967296
float(4294967296)
(0x100000000)
Actual result:
--------------
2147483647
int(2147483647)
(0x7FFFFFFF)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32211&edit=1