How to find the value closest to positive infinity in Python?



Although infinity doesn't have a concrete representation, the closest number to infinity is represented as return value of float() function with 'inf' as argument

>>> a=float('inf')
>>> a
inf


Updated on: 2020-03-02T10:18:04+05:30

239 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements