We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd14a66 commit 07732b4Copy full SHA for 07732b4
1 file changed
Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js
@@ -12,7 +12,7 @@
12
13
function isProperFraction(numerator, denominator) {
14
// TODO: Implement this function
15
- if (denominator === 0 || numerator / denominator > 1) {
+ if (denominator === 0 || Math.abs(numerator / denominator) > 1) {
16
return false;
17
}
18
return true;
@@ -50,6 +50,12 @@ const testCases = [
50
[6, 3, false],
51
[8, 4, false],
52
[10, 5, false],
53
+ [-1, 2, true],
54
+ [2, -4, true],
55
+ [-3, -6, true],
56
+ [-4, 0, false],
57
+ [0, 5, true],
58
+ [-5, 4, false],
59
];
60
61
// loop through each case and assert that the output is correct
0 commit comments