Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.nan Constant

Python math.nan Constant

Python math Module Python math Module

Python math.nan Returns the floating-point value nan (not a number), which is not a valid number.

math.nan Equivalent to the output of float('nan').

Syntax

The syntax of the math.nan constant is as follows:

math.nan

Return Value

Returns the floating-point number nan.

Example

The following example returns nan:

Example

Import the math package

import

math

Output nan

print

(

math

.

nan

)

Output the type of nan

print

(

type

(

math

.

nan

)

)

Output result:


nan

Python math Module Python math Module