@@ -14,14 +14,19 @@ function isProperFraction(numerator, denominator) {
1414 if ( numerator >= denominator ) {
1515 return false ;
1616 }
17- if ( numerator == 0 && denominator !== 0 ) {
17+ if ( numerator == 0 && denominator !== 0 ) {
1818 return true ;
1919 }
2020 if ( denominator === 0 ) {
2121 return false ;
2222 }
23+ if ( numerator == denominator ) {
24+ return false ;
25+ }
26+ if ( numerator < 0 && denominator > 0 && Math . abs ( numerator ) < denominator ) {
27+ return true ;
28+ }
2329}
24-
2530// The line below allows us to load the isProperFraction function into tests in other files.
2631// This will be useful in the "rewrite tests with jest" step.
2732module . exports = isProperFraction ;
@@ -74,7 +79,7 @@ const zeroNumerator = isProperFraction(0, 5);
7479// ====> complete with your assertion
7580assertEquals ( zeroNumerator , true ) ;
7681// Zero Denominator check:
77- // Input: numerator = 4, denominator = 0
82+ // Input: numerator = 4, denominator = 0
7883// target output: false
7984// Explanation: The fraction 4/0 is undefined because division by zero is not allowed. The function should return false.
8085const zeroDenominator = isProperFraction ( 4 , 0 ) ;
@@ -100,4 +105,4 @@ assertEquals(bothNegative, true);
100105// Explanation: The fraction 0/0 is undefined. The function should return false.
101106const zeroNumeratorDenominator = isProperFraction ( 0 , 0 ) ;
102107// ====> complete with your assertion
103- assertEquals ( zeroNumeratorDenominator , false ) ;
108+ assertEquals ( zeroNumeratorDenominator , false ) ;
0 commit comments