Bug #67676 [NEW]: (int) return wrong number
| From: | andreiotetea at yahoo dot com | Date: | Thu, 24 Jul 2014 12:57:00 +0000 |
| Subject: | Bug #67676 [NEW]: (int) return wrong number | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186797@lists.php.net to get a copy of this message | ||
From: andreiotetea at yahoo dot com
Operating system: Linux, Windows, all
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:(int) return wrong number
Description:
------------
this is a general BUG, no matter of system used or php version..on all
is same
tested here too: http://sandbox.onlinephpfunctions.com/
(int) is returning wrong number without trim.
Test script:
---------------
<?php
$number = 10.03;
$mfactor = pow(10,2);
echo (int)($number * $mfactor); // 1002 - wrong
echo (int)trim($number * $mfactor); // 1003 - good
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=67676&edit=1
--