#41951 [Fbk->Opn]: floats are stored as ints
ID: 41951
User updated by: rachmel at avaya dot com
Reported By: rachmel at avaya dot com
-Status: Feedback
+Status: Open
Bug Type: *Math Functions
Operating System: WindRiver Linux
PHP Version: 5.2.3
New Comment:
Hi,
I tried the CVS head version you offered me in the above link. The
problem is still there, and the numbers are not converted to float as
expected.
Previous Comments:
------------------------------------------------------------------------
[2007-07-10 14:10:06] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
------------------------------------------------------------------------
[2007-07-10 13:54:39] rachmel at avaya dot com
Description:
------------
I am cross compiling php from i686-red-hat linux plat to ppc-windriver
linux plat.
The problem I see, is that when trying to assign a value bigger than
MAX_INT (2147483648-1), the variable gets the value of MAX_INT-1.
This is not just an explicit variable issue. Just trying to 'echo' the
same value results in the same problem.
When compiling for my i686 platform, this problem doesn't occur.
I am upgrading from php 5.1.4, and I didn't have any problems in that
version.
Reproduce code:
---------------
<?php
$a = 0x8fffffff;
$b = 2415919103;
var_dump($a);
var_dump($b);
?>
Expected result:
----------------
float(2415919103)
float(2415919103)
Actual result:
--------------
int(2147483647)
int(2147483647)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41951&edit=1
Thread (7 messages)