Skip to content

Commit 7a5fe08

Browse files
committed
Added function(isProperFraction)
1 parent 3fafedf commit 7a5fe08

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function isProperFraction(numerator, denominator) {
2-
if (numerator < denominator) return true;
3-
// add your completed function from key-implement here
2+
if (Math.abs(numerator) < Math.abs(denominator)) return true; // This version of code works correctly for proper and negative fractions.
3+
if (Math.abs(numerator) >= Math.abs(denominator)) return false;
4+
if (Math.abs(numerator) === Math.abs(denominator)) return false;
45
}
56

6-
module.exports = isProperFraction;
7+
module.exports = isProperFraction;

0 commit comments

Comments
 (0)