Skip to content

Commit 5d4a5d7

Browse files
implement isProperFraction function to validate proper fractions
1 parent 3b5aa4e commit 5d4a5d7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎implement-and-rewrite-tests/implement/2-is-proper-fraction.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
// execute the code to ensure all tests pass.
1515

1616
export function isProperFraction(numerator, denominator) {
17-
// TODO: Implement this function
17+
if (denominator === 0) {
18+
return false;
19+
}
20+
21+
return Math.abs(numerator) < Math.abs(denominator);
1822
}

0 commit comments

Comments
 (0)