Skip to content

Commit 63246ca

Browse files
authored
Editing the code
1 parent 17435c8 commit 63246ca

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

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

1010
function isProperFraction(numerator, denominator) {
11-
if (numerator < denominator) {
12-
return true;
13-
}
14-
if (numerator < 0 && Math.abs(numerator) < denominator) {
15-
return false;
11+
if (denominator === 0) {
12+
return false;
1613
}
17-
if (numerator >= denominator) {
18-
return false;
19-
}
20-
// we could add more checks here for invalid input, but not required for this exercise
14+
return Math.abs(numerator) < Math.abs(denominator);
2115
}
2216

2317
// The line below allows us to load the isProperFraction function into tests in other files.

0 commit comments

Comments
 (0)