|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-04-18 17:43 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
[2013-04-18 17:43 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jan 08 12:00:01 2026 UTC |
Description: ------------ When trying to cast a numeric string value in the exponential notation to int, the result doesn't match with the initial value. While the casting to float from string works well. Also casting to int from the same value stored in a float variable workes well. The function intval() has the same problem. Test script: --------------- <?php echo 1E2 . "<br />"; echo (float)1E2 . "<br />"; echo (int)1E2 . "<br />"; echo intval(1E2) . "<br />"; echo (float)"1E2" . "<br />"; echo (int)"1E2" . "<br />";//problem echo intval("1E2") . "<br />";//problem ?> Expected result: ---------------- 100 100 100 100 100 100 100 Actual result: -------------- 100 100 100 100 100 1 1