3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 0.03; $b = 1 - 0.97; $c = (float)(string) 0.03; $d = (float)(string) (1 - 0.97); var_dump($a, $b, $a === $b, $c, $d, $c === $d); var_dump(sprintf('%1.16f', $b), sprintf('%1.16f', $d));
Output for 4.3.0 - 7.1.7
float(0.03) float(0.03) bool(false) float(0.03) float(0.03) bool(true) string(18) "0.0300000000000000" string(18) "0.0300000000000000"