Bug #55388 [Opn->Bgs]: type conversion problem
| From: | laruence@php.net | Date: | Sat, 13 Aug 2011 10:42:37 +0000 |
| Subject: | Bug #55388 [Opn->Bgs]: type conversion problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162562@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55388&edit=1
ID: 55388
Updated by: laruence@php.net
Reported by: admin at micropro dot cz
Summary: type conversion problem
-Status: Open
+Status: Bogus
Type: Bug
Package: *General Issues
Operating System: Windows 7, Debian Linux
PHP Version: 5.3.6
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:
------------------------------------------------------------------------
[2011-08-09 21:55:18] admin at micropro dot cz
Description:
------------
Problem with float whole numbers in type conversion.
Test script:
---------------
// This outputs: float(920)
var_dump('9.2' * 100);
// This outputs: int(919)
var_dump(intval('9.2' * 100));
// This outputs: int(920)
var_dump(intval(strval('9.2' * 100)));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55388&edit=1