Skip to content

Commit ce5042a

Browse files
committed
stopped using for to generate floating point numbers and wrote everything.
1 parent f939b97 commit ce5042a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ext/standard/tests/math/bug24142.phpt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
Bug #24142 (round() problems)
33
--FILE--
44
<?php
5-
$v = 0.005;
6-
for ($i = 1; $i < 10; $i++) {
7-
echo "round({$v}, 2) -> ".round($v, 2)."\n";
8-
$v += 0.01;
9-
}
5+
echo 'round(0.005, 2) -> '.round(0.005, 2)."\n";
6+
echo 'round(0.015, 2) -> '.round(0.015, 2)."\n";
7+
echo 'round(0.025, 2) -> '.round(0.025, 2)."\n";
8+
echo 'round(0.035, 2) -> '.round(0.035, 2)."\n";
9+
echo 'round(0.045, 2) -> '.round(0.045, 2)."\n";
10+
echo 'round(0.055, 2) -> '.round(0.055, 2)."\n";
11+
echo 'round(0.065, 2) -> '.round(0.065, 2)."\n";
12+
echo 'round(0.075, 2) -> '.round(0.075, 2)."\n";
13+
echo 'round(0.085, 2) -> '.round(0.085, 2)."\n";
1014
?>
1115
--EXPECT--
1216
round(0.005, 2) -> 0.01

0 commit comments

Comments
 (0)