Files
codeql/python/ql/src/Expressions/CompareIdenticalValues.py
2018-11-19 15:10:42 +00:00

8 lines
230 B
Python

#Using 'x == x' to check that 'x' is not a float('nan').
def is_normal(f):
return not cmath.isinf(f) and f == f
#Improved version; intention is explicit.
def is_normal(f):
return not cmath.isinf(f) and not cmath.isnan(f)