Commit 07117007 by ichuang Committed by Matthew Mongeau

util: tol.endswith

parent 0995116a
...@@ -13,7 +13,7 @@ def compare_with_tolerance(v1, v2, tol): ...@@ -13,7 +13,7 @@ def compare_with_tolerance(v1, v2, tol):
- tol : tolerance (string or number) - tol : tolerance (string or number)
''' '''
relative = "%" in tol relative = tol.endswith('%')
if relative: if relative:
tolerance_rel = evaluator(dict(),dict(),tol[:-1]) * 0.01 tolerance_rel = evaluator(dict(),dict(),tol[:-1]) * 0.01
tolerance = tolerance_rel * max(abs(v1), abs(v2)) tolerance = tolerance_rel * max(abs(v1), abs(v2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment