Skip to content

Commit 424fb3a

Browse files
Update isProperFraction validation logic to accept only integers.
Refactor isProperFraction to validate integers instead of finite numbers.
1 parent 6b77070 commit 424fb3a

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
// execute the code to ensure all tests pass.
1212

1313
function isProperFraction(numerator, denominator) {
14-
if (!Number.isFinite(numerator) || !Number.isFinite(denominator)) {
15-
return false;
16-
}
1714
if (!Number.isInteger(numerator) || !Number.isInteger(denominator)) {
18-
return false;
15+
return false; // provided that the numerator and denominator are integers, not fintite numbers based on the assumption that the parameters are valid numbers (not NaN or Infinity, or any other non-integer numbers)
1916
}
2017
if (denominator === 0) {
2118
return false;

0 commit comments

Comments
 (0)