use bignum; $foo = 12345.6789; $bar = $foo->copy()->bfround(0)->bfround(-5); $baz = $foo - $bar; print "what's wrong here? $foo - $bar = $baz\n"; $byhand = 12345.6789 - 12345; print "expected $byhand\n";