mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
8 lines
230 B
Python
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) |