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_isfinite.asp below:

Website Navigation


Python math.isfinite() Method

Python math.isfinite() Method

❮ Math Methods

Example

Check whether a value is finite or not:

# Import math Library

import math

# Check whether the values are finite or not

print(math.isfinite(2000))

print(math.isfinite(-45.34))

print(math.isfinite(+45.34))

print(math.isfinite(math.inf))

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

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

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

print(math.isfinite(-math.inf))

print(math.isfinite(0.0))

Try it Yourself » Definition and Usage

The math.isfinite() method checks whether a number is finite or not.

This method returns True if the specified number is a finite number, otherwise it returns False.

Syntax Parameter Values Parameter Description x Required. The value to check. Must be a number (float/integer/infinite/NaN/finite) Technical Details Return Value: A bool value, True if x is finite, False if x is either an infinity or a NaN Python Version: New in Python 3.2

❮ 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