Recently came across a situation where I was working on a server that had a php.ini file with:
precision = 16
The default being 14, this seems harmless enough. Unfortunately it lead to this:
// ini_set('precision', 16);
echo round((20.12 / 36.79),4);
Result: 0.5469000000000001
Huh? Shouldn't round()
be taking care of the floating point precision issues here?