Skip to content

Commit 3e9ab28

Browse files
committed
Use Math.abs function for both numerator and denominator
1 parent ebad589 commit 3e9ab28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
function isProperFraction(numerator, denominator) {
1111
if (denominator === 0) return false;
12-
if (numerator < 1) numerator = numerator * -1;
12+
if (numerator < 1) numerator = Math.abs(numerator) ;
1313
if (denominator < 1) denominator = Math.abs(denominator);
1414

1515
if (numerator < denominator) {

0 commit comments

Comments
 (0)