added a check if denominator is zero
This commit is contained in:
parent
326ae0cd88
commit
1dd96577b2
|
@ -269,6 +269,9 @@ class ApproxMapping(ApproxBase):
|
|||
max_abs_diff = max(
|
||||
max_abs_diff, abs(approx_value.expected - other_value)
|
||||
)
|
||||
if approx_value.expected == 0.0:
|
||||
max_rel_diff = math.inf
|
||||
else:
|
||||
max_rel_diff = max(
|
||||
max_rel_diff,
|
||||
abs((approx_value.expected - other_value) / approx_value.expected),
|
||||
|
|
Loading…
Reference in New Issue