Skip to content

Instantly share code, notes, and snippets.

@aarshtalati
Created October 22, 2017 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarshtalati/917d4aed2aabd4a15a6485b10a9c23a0 to your computer and use it in GitHub Desktop.
Save aarshtalati/917d4aed2aabd4a15a6485b10a9c23a0 to your computer and use it in GitHub Desktop.
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