<?php
echo var_export(20 / 3 * 1e6, true) . "\n";
echo var_export(6.66, true) . "\n";
echo var_export(6.0, true) . "\n";
function format($f) {
return rtrim(rtrim(number_format($f, ini_get('precision'), '.', ''), '0.'), '.');
}
echo format(20/3) . "\n";
echo format(200000000 / 3) . "\n";
echo 200000000 / 3 . "\n";
echo format(6.66) . "\n";
echo format(6.0) . "\n";
echo format(60.0) . "\n";
- Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
- 6666666.666666667
6.66
6.0
6.66666666666667
66666666.66666666418314
66666666.666667
6.66
6
6
- Output for 7.0.2 - 7.0.20
- 6666666.666666667
6.6600000000000001
6.0
6.66666666666667
66666666.66666666418314
66666666.666667
6.66
6
6
- Output for 5.4.22 - 5.4.45, 5.5.6 - 5.5.38, 5.6.0 - 5.6.30, 7.0.0 - 7.0.1
- 6666666.666666667
6.6600000000000001
6
6.66666666666667
66666666.66666666418314
66666666.666667
6.66
6
6
- Output for 4.3.0 - 4.3.4, 5.3.0 - 5.3.29, 5.4.0 - 5.4.21, 5.5.0 - 5.5.5
- 6666666.6666667
6.66
6
6.66666666666667
66666666.66666666418314
66666666.666667
6.66
6
6
- Output for 4.3.5 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
- 6666666.6666667
6.66
6
6.66666666666667
66666666.66666665673256
66666666.666667
6.66
6
6
preferences:
271.76 ms | 402 KiB | 382 Q