Skip to content

Commit 780c9f9

Browse files
committed
is-proper-fraction exercise completed
1 parent 4f6ab7b commit 780c9f9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
function isProperFraction(numerator, denominator) {
1414
// TODO: Implement this function
15+
// if (numerator < denominator) {
16+
// return true
17+
// }
18+
return numerator < denominator;
1519
}
1620

1721
// The line below allows us to load the isProperFraction function into tests in other files.
@@ -31,3 +35,12 @@ function assertEquals(actualOutput, targetOutput) {
3135

3236
// Example: 1/2 is a proper fraction
3337
assertEquals(isProperFraction(1, 2), true);
38+
39+
40+
// Tests
41+
assertEquals(isProperFraction(2, 3), true);
42+
assertEquals(isProperFraction(3, 1), false);
43+
assertEquals(isProperFraction(-1, -6), false);
44+
assertEquals(isProperFraction(-1, 0), true);
45+
assertEquals(isProperFraction(1, 1), false);
46+
assertEquals(isProperFraction(-6, 6), true);

0 commit comments

Comments
 (0)