util: tol.endswith

This commit is contained in:
ichuang
2012-06-12 13:43:14 -04:00
committed by Matthew Mongeau
parent a424fbd1f6
commit 413fe95017

View File

@@ -13,7 +13,7 @@ def compare_with_tolerance(v1, v2, tol):
- tol : tolerance (string or number)
'''
relative = "%" in tol
relative = tol.endswith('%')
if relative:
tolerance_rel = evaluator(dict(),dict(),tol[:-1]) * 0.01
tolerance = tolerance_rel * max(abs(v1), abs(v2))