- var_dump: documentation ( source)
- round: documentation ( source)
<?php
var_dump(4.22/0.01 == (int)(4.22/0.01)); // false
var_dump([
'4.22*(1/0.01)' => 4.22*(1/0.01),
'4.22/0.01' => 4.22/0.01,
'(int)(4.22/0.01)' => (int)(4.22/0.01),
'(int)(string)(4.22/0.01)' => (int)(string)(4.22/0.01)
]);
var_dump(4.22*(1/0.01) == (int)(4.22*(1/0.01))); // true
var_dump((string)(4.22/0.01) == (int)(string)(4.22/0.01)); // true
var_dump(round(4.22/0.01, 4) == (int)round(4.22/0.01, 4)); // true
var_dump(bcdiv((string)4.22,(string)0.01, 10));