xref: /PHP-8.4/ext/standard/tests/math/bug24142.phpt (revision 78970ef6)
1--TEST--
2Bug #24142 (round() problems)
3--FILE--
4<?php
5echo "round(0.005, 2)\n";
6var_dump(round(0.005, 2));
7echo "\n";
8
9echo "round(0.015, 2)\n";
10var_dump(round(0.015, 2));
11echo "\n";
12
13echo "round(0.025, 2)\n";
14var_dump(round(0.025, 2));
15echo "\n";
16
17echo "round(0.035, 2)\n";
18var_dump(round(0.035, 2));
19echo "\n";
20
21echo "round(0.045, 2)\n";
22var_dump(round(0.045, 2));
23echo "\n";
24
25echo "round(0.055, 2)\n";
26var_dump(round(0.055, 2));
27echo "\n";
28
29echo "round(0.065, 2)\n";
30var_dump(round(0.065, 2));
31echo "\n";
32
33echo "round(0.075, 2)\n";
34var_dump(round(0.075, 2));
35echo "\n";
36
37echo "round(0.085, 2)\n";
38var_dump(round(0.085, 2));
39?>
40--EXPECT--
41round(0.005, 2)
42float(0.01)
43
44round(0.015, 2)
45float(0.02)
46
47round(0.025, 2)
48float(0.03)
49
50round(0.035, 2)
51float(0.04)
52
53round(0.045, 2)
54float(0.05)
55
56round(0.055, 2)
57float(0.06)
58
59round(0.065, 2)
60float(0.07)
61
62round(0.075, 2)
63float(0.08)
64
65round(0.085, 2)
66float(0.09)
67