VOOZH about

URL: https://www.geeksforgeeks.org/python/python-math-library-isnan-method/

⇱ Python math library | isnan() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python math library | isnan() method

Last Updated : 20 Feb, 2023

Python has math library and has many functions regarding it. One such function is isnan(). This method is used to check whether a given parameter is a valid number or not.

Syntax : math.isnan(x) Parameters : x [Required] : It is any valid python data type or any number. Returns: Return type is boolean. -> Returns False if the given parameter is any number(positive or negative) -> Returns True if given parameter is NaN (Not a Number).

Time Complexity: O(1)

Auxiliary Space: O(1)

Code #1: 

Output:
False
False
False

  Code #2: 

Output:
False
False
True
Comment