Skip to content

Commit

Permalink
Fix division by 0 error in test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Jan 14, 2025
1 parent f2e060c commit e8d12cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/testRunner
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def intCompare(answer, value, percentage):
# Check if error between value and answer is greater than the allowed percentage
if answer == value:
return True
if percentage != 0:
if percentage != 0 and answer != 0:
percentageOff = abs(int(100 - (float(value)/float(answer) * 100)))
if percentageOff <= percentage:
return True
Expand Down

0 comments on commit e8d12cd

Please sign in to comment.