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

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -