About 50 results
Open links in new tab
  1. How to represent an infinite number in Python? - Stack Overflow

    Aug 23, 2024 · How can I represent an infinite number in python? No matter which number you enter in the program, no number should be greater than this representation of infinity.

  2. Infinite integer in Python - Stack Overflow

    Jul 5, 2014 · Infinity is not an integer. It's not a real number either but it comes up more often in the kind of arithmetic that floating point numbers are used for (e.g. involving transcendental and trigonometric …

  3. python - What is inf and nan? - Stack Overflow

    Jul 13, 2013 · inf is infinity - a value that is greater than any other value. -inf is therefore smaller than any other value. nan stands for Not A Number, and this is not equal to 0. Although positive and negative …

  4. Python Infinity - Any caveats? - Stack Overflow

    Feb 7, 2018 · Python's implementation follows the IEEE-754 standard pretty well, which you can use as a guidance, but it relies on the underlying system it was compiled on, so platform differences may …

  5. python - difference between np.inf and float ('Inf') - Stack Overflow

    Feb 18, 2017 · Is there some difference between NumPy np.inf and float ('Inf')? float ('Inf') == np.inf returns True, so it seems they are interchangeable, thus I was wondering why NumPy has defined its …

  6. What is the point of float('inf') in Python? - Stack Overflow

    Dec 14, 2015 · From the Python 2.6 changelog: Many floating-point features were added. The float () function will now turn the string nan into an IEEE 754 Not A Number value, and +inf and -inf into …

  7. Testing for positive infinity, or negative infinity, individually in Python

    Jan 23, 2015 · Testing for positive infinity, or negative infinity, individually in Python Asked 11 years ago Modified 4 years, 1 month ago Viewed 98k times

  8. How to implement negative infinity in Python? - Stack Overflow

    Mar 2, 2013 · How to implement negative infinity in Python? Asked 13 years, 1 month ago Modified 1 year, 5 months ago Viewed 43k times

  9. python - How to set a number to NaN or infinity? - Stack Overflow

    Mar 25, 2011 · Is it possible to set an element of an array to NaN in Python? Additionally, is it possible to set a variable to +/- infinity? If so, is there any function to check whether a number is infinity or...

  10. How do I type a floating point infinity literal in python

    May 24, 2015 · In python 2.6 it is portable if the CPU supports it The float () function will now turn the string nan into an IEEE 754 Not A Number value, and +inf and -inf into positive or negative infinity.