Can anyone please tell me why the following returns "1.7763568394003E-15" instead of 0?
echo 2.95*3-8.85;
Thanks, John
because the internal representation of floating point numbers may lead to inaccurate results in some calculations.
anyway, the inaccuracy is rather negligible.
Thanks for the reply. Is there any way to get it to return accurate results?
Information on floating-point precision is here. BCMath functions are here.