#43241 [Opn]: Float Precision/Representation and Modulo

From: Date: Sun, 11 Nov 2007 10:49:04 +0000
Subject: #43241 [Opn]: Float Precision/Representation and Modulo
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119435@lists.php.net to get a copy of this message
ID: 43241 Updated by: felipe@php.net Reported By: quake5 at gmx dot de Status: Open -Bug Type: Unknown/Other Function +Bug Type: Scripting Engine problem Operating System: MacOS PHP Version: 5.2.5 New Comment: This is documented. See "Integer overflow" ( http://br.php.net/integer ) felipe@pena:~$ php -r 'var_dump(73.82 * 100);' float(7382) felipe@pena:~$ php -r 'var_dump(73.82 * 100 % 2);' int(1) felipe@pena:~$ php -r 'var_dump(round(73.82 * 100) % 2);' int(0) Previous Comments: ------------------------------------------------------------------------ [2007-11-11 02:44:42] quake5 at gmx dot de Description: ------------ Float Precision/Representation and Modulo Reproduce code: --------------- <?php var_dump(73.82 * 100 % 2); ?> Expected result: ---------------- int(0) Actual result: -------------- int(1) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43241&edit=1

« previous php.bugs (#119435) next »