We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17435c8 commit 63246caCopy full SHA for 63246ca
Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js
@@ -8,16 +8,10 @@
8
// write one test at a time, and make it pass, build your solution up methodically
9
10
function isProperFraction(numerator, denominator) {
11
- if (numerator < denominator) {
12
- return true;
13
- }
14
- if (numerator < 0 && Math.abs(numerator) < denominator) {
15
- return false;
+ if (denominator === 0) {
+ return false;
16
}
17
- if (numerator >= denominator) {
18
19
20
- // we could add more checks here for invalid input, but not required for this exercise
+ return Math.abs(numerator) < Math.abs(denominator);
21
22
23
// The line below allows us to load the isProperFraction function into tests in other files.
0 commit comments