#22179 [Fbk->NoF]: convert float to int crashes

From: Date: Thu, 20 Feb 2003 14:18:26 +0000
Subject: #22179 [Fbk->NoF]: convert float to int crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-33723@lists.php.net to get a copy of this message
ID: 22179 Updated by: sniper@php.net Reported By: csmall at enc dot com dot au -Status: Feedback +Status: No Feedback Bug Type: Reproducible crash Operating System: Debian GNU/Linux PHP Version: 4.2.3 New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. Previous Comments: ------------------------------------------------------------------------ [2003-02-11 19:07:03] helly@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2003-02-11 18:59:49] csmall at enc dot com dot au <? $b = "NAN"; $c = (float)$b; $sum = 0; $sum+= (int)$c; echo "B is $b, C is $c, sum is $sum\n"; ?> i386 says sum is 0 alpha just does a floating point exception sparc64 says sum is 2147483647 powerpc says sum is -2147483648 It should be 0, I guess. If you prefer a one-liner: <? echo (int)((float)"NAN")."\n"; ?> Same result. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22179&edit=1

« previous php.bugs (#33723) next »