Skip to content

Commit

Permalink
abs is built-in, not in math
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesParrott committed Jun 11, 2024
1 parent 41e88a9 commit 5621c4b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def almost_equal(a, b, abs_tol = 2e-15):
last_a = match_a.end(0)
last_b = match_b.end(0)

if math.abs(float(match_a.group(0)) - float(match_b.group(0))) > abs_tol:
if abs(float(match_a.group(0)) - float(match_b.group(0))) > abs_tol:
print('float(match_a.group(0)): %s, float(match_b.group(0)): %s'
% (float(match_a.group(0)), float(match_b.group(0))))
return False
Expand Down

0 comments on commit 5621c4b

Please sign in to comment.