Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python cmath.nan is used to return a floating-point "not a number" (NaN) value. It is equivalent to the output of float('nan').

Syntax

#New in version 3.6
cmath.nan

Parameters

No parameter is required.

Return Value

Returns a floating-point "not a number" (NaN) value.

Example:

The below example shows the usage of cmath.nan.

import cmath

#print the value of nan
print(cmath.nan)

The output of the above code will be:

nan

❮ Python cMath Module