Bug #69039 [Opn->Nab]: (int)
| From: | nikic@php.net | Date: | Thu, 12 Feb 2015 11:39:25 +0000 |
| Subject: | Bug #69039 [Opn->Nab]: (int) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-190622@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69039&edit=1
ID: 69039
Updated by: nikic@php.net
Reported by: marc at webetsolutions dot com
Summary: (int)
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Floating point values have a limited precision. Hence a value might
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly
printing it without any mathematical operations.
If you would like to know more about "floats" and what IEEE
754 is, read this:
http://www.floating-point-gui.de/
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2015-02-12 09:26:36] marc at webetsolutions dot com
Description:
------------
Just a litle question
if i calculate
echo 264.40 * 100;
The result is : 26440
if i calculate
echo (int)(264.40 * 100);
The result is 26439
The problem seem to be for 255 to 327
Why ?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69039&edit=1