Skip to content

Commit 632c967

Browse files
committed
Updated my code.
1 parent 3b28213 commit 632c967

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88
// write one test at a time, and make it pass, build your solution up methodically
99

1010
function isProperFraction(numerator, denominator) {
11-
if (Math.abs(numerator) < Math.abs(denominator)) return true; // This version of code works correctly for proper and negative fractions.
12-
if (Math.abs(numerator) >= Math.abs(denominator)) return false;
13-
if (Math.abs(numerator) === Math.abs(denominator)) return false;
14-
15-
// if (numerator < denominator) {
16-
// return true;
17-
// }
11+
return Math.abs(numerator) < Math.abs(denominator);
12+
1813

1914
}
2015

@@ -67,5 +62,5 @@ console.log(isProperFraction(5, 2));
6762
console.log(isProperFraction(-4, 7));
6863
console.log(isProperFraction(-3, 3));
6964
console.log(isProperFraction(-2, -3)); // This is a proper fraction because the absolute value of numerator 2 and denominator is 3.
70-
// the value of numerator is less than denominator.
65+
// // the value of numerator is less than denominator.
7166
console.log(isProperFraction(-4, -7));

0 commit comments

Comments
 (0)