php - How to ACCURATELY subtract two floating point values
one text
Solution:
Please round the result:
$a = 1865183.4082;
$b = 1865183.408200000000000000;
echo $result = round($a - $b, 2);
Sourceone text
Please round the result:
$a = 1865183.4082;
$b = 1865183.408200000000000000;
echo $result = round($a - $b, 2);
Source