rounding - Loss of significance php round -


this question has answer here:

i have following code

$suma += round(1*43067.8000,2);  $suma += round(-1*18875.1800,2);  $suma += round(-1*15293.9700,2);  $suma += round(-1*8898.6500,2);  print $suma; 

the output 3.6379788070917e-12

why answer not 0 if number rounded before addition?

round still returns float. because float there might small errors. in case, causes answer differ 0.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -