#45854 [Fbk->Asn]: intval returns a negative number

From: Date: Mon, 18 Aug 2008 18:13:15 +0000
Subject: #45854 [Fbk->Asn]: intval returns a negative number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-128198@lists.php.net to get a copy of this message
ID: 45854 Updated by: jani@php.net Reported By: olivarra1 at hotmail dot com -Status: Feedback +Status: Assigned Bug Type: Math related -Operating System: Windows XP Professional +Operating System: win32 only -PHP Version: 5.2.1 +PHP Version: 5.2CVS, 5.3CVS, 6CVS (2008-08-18) -Assigned To: +Assigned To: pajoye New Comment: Nevermind, happens within all branches, but only with windows. Previous Comments: ------------------------------------------------------------------------ [2008-08-18 18:10:48] 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 Works fine for me with PHP 5.2.7-dev. ------------------------------------------------------------------------ [2008-08-18 15:56:12] olivarra1 at hotmail dot com version was 5.2.1, not 5.2CVS-2008-08-18 (CVS) ------------------------------------------------------------------------ [2008-08-18 15:53:16] olivarra1 at hotmail dot com Description: ------------ For too big numbers, intval returns a negative value Reproduce code: --------------- <?php $a = 25 * pow(1.5, 50); echo $a."<br>"; echo intval($a)."<br>"; echo "<br>"; $a = 10 * pow(1.5, 60); echo $a."<br>"; echo intval($a)."<br>"; ?> Expected result: ---------------- 15940537505.4 15940537505 367684687169 367684687169 Actual result: -------------- 15940537505.4 -1239331679 367684687169 -1682500287 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45854&edit=1

« previous php.bugs (#128198) next »