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

Website Navigation


Python math.isinf() Method

Python math.isinf() Method

❮ Math Methods

Example

Check whether a value is infinity or not:

# Import math Library

import math

# Check whether the values are infinite or not

print(math.isinf(56))

print(math.isinf(-45.34))

print(math.isinf(+45.34))

print(math.isinf(math.inf))

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

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

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

print(math.isinf(-math.inf))

Try it Yourself » Definition and Usage

The math.isinf() method checks whether a number is infinite or not.

This method returns True if the specified number is a positive or negative infinity, otherwise it returns False.

Syntax Parameter Values Parameter Description x Required. The number to check Technical Details Return Value: A bool value, True if x is a positive or negative infinity, False otherwise Python Version: 2.6

❮ 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