[php-langspec][Issue #242] - Misleading conversion float to int
| From: | noreply@php.net | Date: | Wed, 25 Sep 2019 13:57:36 +0000 |
| Subject: | [php-langspec][Issue #242] - Misleading conversion float to int | ||
| Groups: | php.standards | ||
| Request: | Send a blank email to standards-+get-1455@lists.php.net to get a copy of this message | ||
You can view the Issue on github:
https://github.com/php/php-langspec/issues/242
Comment by nikic:
32.05*100 is 3204.9999999999995 due to limited float precision, which is 3204 when rounding down,
which is what (int) does (for positive numbers). Use
round() is you want to round.