Welcome folks today in this blog post we will be
checking whether the number is infinite or not in python using math and numpy module. All the full source code of the application is shown below.
In order to get started you need to make an
app.py file and copy paste the following code
import numpy as np import math # Defining a positive infinite integer a = np.inf # Defining a negative infinite integer b = -np.inf # Define a finite integer c = 300 # chech if a in infinite print(math.isinf(a)) # chech if b in infinite print(math.isinf(b)) # chech if c in infinite print(math.isinf(c))
Now if you execute the
python script by typing the below command as shown below