|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-09-13 06:39 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2018-09-13 06:39 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 21:00:01 2026 UTC |
Description: ------------ Just calculations. At the end of them unexpected result Test script: --------------- $total_vote = 2.9; $points_teaches = [-0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1]; foreach($points_teaches as $point) { $total_vote += $point; } $total_vote += -0.3; $total_vote += -0.3; $total_vote += -0.3; $total_vote += -0.5; $points_p = [-0.05, -0.05, -0.05, -0.05, -0.05 -0.05, -0.05, -0.05, -0.05, -0.05]; $p = 0.0; foreach ($points_p as $points) { $p += $points; } $total_vote += $p; die($total_vote); Expected result: ---------------- $total_vote == 0 Actual result: -------------- $total_vote == -1.1102230246252E-15