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 30ac3b1 commit debd986Copy full SHA for debd986
Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js
@@ -10,11 +10,9 @@
10
function isProperFraction(numerator, denominator) {
11
if (denominator === 0) {
12
return "Invalid — denominator cannot be zero";
13
- } else if (numerator * numerator < denominator * denominator) {
14
- return true;
15
- } else {
16
- return false;
17
}
+
+ return Math.abs(numerator) < Math.abs(denominator);
18
19
20
// The line below allows us to load the isProperFraction function into tests in other files.
0 commit comments