I'm new to math in PHP. I'm working on calculating cryptocurrencies that have up to 18 decimal places. What is the best way to calculate this precisely in PHP? Most answers on SO are for other coding languages and about rounding.
For example, when I do the below, I don't get 0.000000000000000001 as an answer.
$a= 0.000000000000000002;
$b= 0.000000000000000001;
$balance = $a - $b;
What I get is -8.0E-20
which is not 0.000000000000000001 (i think).
Also, [from here][1], it says float has a max of 14 decimal places
but then it used the word "roughly."