|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-03-12 18:47 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2013-03-12 18:47 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ If I multiply 19.99 with 100 and cast it to int, I expect a value of 1999, but I get 1998. I verified this on 5 different php 5.4 installations on Mac OSX 10.8.2, Debian and Ubuntu. Test script: --------------- <?php var_dump('TEST #1'); var_dump($x = floatval(19.99 * 100)); var_dump($x = intval($x)); var_dump('TEST #2'); var_dump($x = floatval(1999)); var_dump($x = intval($x)); Expected result: ---------------- string(7) "TEST #1" double(1999) int(1999) Actual result: -------------- string(7) "TEST #2" double(1999) int(1998)