Edit report at https://bugs.php.net/bug.php?id=55388&edit=1

 ID:                 55388
 Updated by:         larue...@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

Reply via email to