#37554 [Opn->Bgs]: strange behavior of intval()

From: Date: Tue, 23 May 2006 06:28:45 +0000
Subject: #37554 [Opn->Bgs]: strange behavior of intval()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97462@lists.php.net to get a copy of this message
ID: 37554 Updated by: derick@php.net Reported By: hsunke at muenster dot de -Status: Open +Status: Bogus Bug Type: Math related Operating System: Debian Linux PHP Version: 5.1.4 New Comment: Might be funny... but it's still the same problem. Previous Comments: ------------------------------------------------------------------------ [2006-05-22 22:29:15] hsunke at muenster dot de Description: ------------ I know about "unpredictable" issues with floatingpoint calculations, but this one is quite funny: ... echo intval(100*(27/100)); //output: 27 echo intval(100*(28/100)); //output: 28 echo intval(100*(29/100)); //output: 28 echo intval(100*(30/100)); //output: 30 echo intval(100*(31/100)); //output: 31 ... Reproduce code: --------------- echo intval(100*(29/100)); Expected result: ---------------- 29 Actual result: -------------- 28 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37554&edit=1

« previous php.bugs (#97462) next »