Skip to content

Commit 1610b10

Browse files
committed
implement proper fractions
1 parent e5625a3 commit 1610b10

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// execute the code to ensure all tests pass.
1212

1313
function isProperFraction(numerator, denominator) {
14-
// TODO: Implement this function
14+
return numerator < denominator ? true : false;
1515
}
1616

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

3232
// Example: 1/2 is a proper fraction
3333
assertEquals(isProperFraction(1, 2), true);
34+
assertEquals(isProperFraction(2, 1), false);
35+
assertEquals(isProperFraction(0, 0), false);
36+
assertEquals(isProperFraction(-0, 0), false);
37+
assertEquals(isProperFraction(-5, 4), true);
38+
assertEquals(isProperFraction(-4, -5), false);

0 commit comments

Comments
 (0)