Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def IsClose(value, target, threshold=0.02):
result = (value / target)
result = ((1 - threshold) <= result) and (result <= (1 + threshold))
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment