Skip to content

Commit 97162cd

Browse files
Merge pull request #77 from lambda-feedback/tr112-atol-rtol-zero-behaviour
Fixed potential bug when either atol or rtol is zero but the other on…
2 parents aadf477 + 1da8e19 commit 97162cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/evaluation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ def replace_pi(expr):
164164
return expr.subs(pi_symbol, float(pi))
165165
ans = replace_pi(ans)
166166
res = replace_pi(res)
167-
if "atol" in params.keys():
167+
if float(params.get("atol", 0)) > 0:
168168
try:
169169
absolute_error = abs(float(ans-res))
170170
error_below_atol = bool(absolute_error < float(params["atol"]))
171171
except TypeError:
172172
error_below_atol = None
173173
else:
174174
error_below_atol = True
175-
if "rtol" in params.keys():
175+
if float(params.get("rtol", 0)) > 0:
176176
try:
177177
relative_error = abs(float((ans-res)/ans))
178178
error_below_rtol = bool(relative_error < float(params["rtol"]))

0 commit comments

Comments
 (0)