Skip to content

Commit 442f828

Browse files
committed
change to proper
1 parent a676980 commit 442f828

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
function isProperFraction(numerator, denominator) {
1414
// TODO: Implement this function
1515
if (denominator === 0) return false;
16-
if (denominator < 0) return false;
1716

18-
return Math.abs(numerator) < denominator;
17+
return Math.abs(numerator) < Math.abs(denominator);
1918
}
2019

2120
// The line below allows us to load the isProperFraction function into tests in other files.
@@ -52,7 +51,7 @@ assertEquals(isProperFraction(-3, 2), false);
5251

5352
// Denominator edge cases
5453
assertEquals(isProperFraction(1, 0), false);
55-
assertEquals(isProperFraction(1, -2), false);
56-
assertEquals(isProperFraction(-1, -2), false);
54+
assertEquals(isProperFraction(1, -2), true);
55+
assertEquals(isProperFraction(-1, -2), true);
5756

5857
console.log ("All tests passed!")

0 commit comments

Comments
 (0)