Skip to content

Commit 7fbe03d

Browse files
committed
Round to 3 decimal places
1 parent 7a8467f commit 7fbe03d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

exercises/infinite-divisions/solution/solution.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
echo match ($res = fdiv($argv[1], $argv[2])) {
1010
INF => 'Infinite',
1111
-INF => 'Minus Infinite',
12-
default => $res
12+
default => round($res, 2)
1313
};
1414

1515
echo "\n";

test/solutions/infinite-divisions/no-divide-in-try.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
echo match ($res = fdiv($argv[1], $argv[2])) {
99
INF => 'Infinite',
1010
-INF => 'Minus infinite',
11-
default => $res
11+
default => round($res, 2)
1212
};
1313

1414
echo "\n";

test/solutions/infinite-divisions/no-division-by-zero-catch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
echo match ($res = fdiv($argv[1], $argv[2])) {
1010
INF => 'Infinite',
1111
-INF => 'Minus infinite',
12-
default => $res
12+
default => round($res, 2)
1313
};
1414

1515
echo "\n";

test/solutions/infinite-divisions/no-try-catch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
echo match ($res = fdiv($argv[1], $argv[2])) {
66
INF => 'Infinite',
77
-INF => 'Minus infinite',
8-
default => $res
8+
default => round($res, 2)
99
};
1010

1111
echo "\n";

test/solutions/infinite-divisions/solution-correct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
echo match ($res = fdiv($argv[1], $argv[2])) {
1010
INF => 'Infinite',
1111
-INF => 'Minus infinite',
12-
default => $res
12+
default => round($res, 2)
1313
};
1414

1515
echo "\n";

0 commit comments

Comments
 (0)