math.nan

Full name
math.nan
Library
math
Syntax

math.nan

Description

math.nan represents the real value "Not a Number" (NaN). It is equivalent to the result of float("nan").

Parameters

math.nan takes no arguments

Result

math.nan returns a real number.

Examples

Let's first confirm the type of the result obtained:

type(math.nan)

float

It is a real number.

Let's now see the output of this attribute:

print(math.nan)

nan

We can confirm that the result is considered a "Not a Number" value with the math.isnan function:

math.isnan(math.nan)

True

Submitted by admin on Tue, 01/19/2021 - 12:36