Python math.nan Constant
Example
Print the value of nan:
# Import math Library
import math
# Print the value of nan
print (math.nan)
Try it Yourself »
Definition and Usage
The math.nan
constant returns a floating-point nan (Not a Number) value. This value is not a legal number.
The nan constant is equivalent to float('nan')
.
Syntax
math.nan
Technical Details
Return Value: | A float value, nan (Not a Number) |
---|---|
Python Version: | 3.5 |