A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_math_isnan.asp below:

Website Navigation


Python math.isnan() Method

Python math.isnan() Method

❮ Math Methods

Example

Check whether a value is NaN or not:

# Import math Library

import math

# Check whether some values are NaN or not

print (math.isnan (56))

print (math.isnan (-45.34))

print (math.isnan (+45.34))

print (math.isnan (math.inf))

print (math.isnan (float("nan")))

print (math.isnan (float("inf")))

print (math.isnan (float("-inf")))

print (math.isnan (math.nan))

Try it Yourself » Definition and Usage

The math.isnan() method checks whether a value is NaN (Not a Number), or not.

This method returns True if the specified value is a NaN, otherwise it returns False.

Syntax Parameter Values Parameter Description x Required. The value to check Technical Details Return Value: A bool value, True if the value is NaN, otherwise False Python Version: 3.5

❮ Math Methods

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4