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 5a07227 commit a417fa0Copy full SHA for a417fa0
Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
@@ -1,6 +1,15 @@
1
+// Explanation:
2
+// It checks if the absolute value of the numerator
3
+// is less than the absolute value of the denominator.
4
+
5
6
function isProperFraction(numerator, denominator) {
- if (numerator < denominator) return true;
- // add your completed function from key-implement here
7
+ if (denominator === 0) {
8
+ throw new Error("Denominator cannot be zero");
9
+ }
10
11
+ return Math.abs(numerator) < Math.abs(denominator);
12
}
13
-module.exports = isProperFraction;
14
+module.exports = isProperFraction;
15
0 commit comments