#30577 [Opn->Bgs]: (int)float truncation
| From: | derick@php.net | Date: | Wed, 27 Oct 2004 09:06:05 +0000 |
| Subject: | #30577 [Opn->Bgs]: (int)float truncation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68377@lists.php.net to get a copy of this message | ||
ID: 30577
Updated by: derick@php.net
Reported By: rick at gibbed dot us
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: win32
PHP Version: 5.0.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
Previous Comments:
------------------------------------------------------------------------
[2004-10-27 07:21:28] rick at gibbed dot us
Description:
------------
On the Windows platform any form of casting done to a float that can
fit in an integer that is above 0x7FFFFFFF gets truncated to 0x7FFFFFFF
rather than assuming the actual signed integer value.
Reproduce code:
---------------
$v = 2147483648; // 0x80000000
var_dump((int)$v);
Expected result:
----------------
int(-2147483648) // 0x80000000
Actual result:
--------------
int(2147483647) // 0x7FFFFFFF
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30577&edit=1