|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-04-19 11:40 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2018-04-19 11:40 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 16:00:01 2025 UTC |
Description: ------------ <?php /* A programmer who does not understand English The description is with Machine Translation */ // Only 32 ~ 122 / whole number will appear, small digital specific.13 and 0.02 $c = 122.13 + 0.02; print_r($c); // 105.15 echo "<br />"; echo json_encode($c); // 105.14999999999999 echo "<br />"; echo json_encode(105.15); // 105.15 Test script: --------------- <?php /* A programmer who does not understand English The description is with Machine Translation PHP Version 7.2.0 json Version 1.6.0 */ // Only 32 ~ 122 / whole number will appear, small digital specific.13 and 0.02 $c = 122.13 + 0.02; print_r($c); // 105.15 echo "<br />"; echo json_encode($c); // 105.14999999999999 echo "<br />"; echo json_encode(105.15); // 105.15 Expected result: ---------------- echo json_encode($c); // 105.15 Actual result: -------------- echo json_encode($c); // 105.14999999999999