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

    Oct 15, 2011 · 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. How to compare floats for almost-equality in Python?

    Python 3.5 adds the math.isclose and cmath.isclose functions as described in PEP 485. If you're using an earlier version of Python, the equivalent function is given in the documentation. def …

  3. math - How can I convert radians to degrees with Python ... - Stack ...

    Mar 26, 2012 · Python includes two functions in the math package; radians converts degrees to radians, and degrees converts radians to degrees. To match the output of your calculator you …

  4. python - How do you round UP a number? - Stack Overflow

    May 5, 2017 · Elaboration: math.ceil returns the smallest integer which is greater than or equal to the input value. This function treats the input as a float (Python does not have strongly-typed …

  5. Function for factorial in Python - Stack Overflow

    Feb 27, 2011 · The easiest way is to use math.factorial (available in Python 2.6 and above): import math math.factorial(1000) If you want/have to write it yourself, you can use an iterative …

  6. What does the ** maths operator do in Python? - Stack Overflow

    What does this mean in Python: sock.recvfrom(2**16) I know what sock is, and I get the gist of the recvfrom function, but what the heck is 2**16? Specifically, the two asterisk/double asterisk ope...

  7. python - How can I use "e" (Euler's number) and power operation ...

    Aug 25, 2016 · You can use exp(x) function of math library, which is same as e^x. Hence you may write your code as: import math x.append(1 - math.exp( -0.5 * (value1*value2)**2)) I have …

  8. math - How do I calculate square root in Python? - Stack Overflow

    Jan 20, 2022 · Python's fractions module and its class, Fraction, implement arithmetic with rational numbers. The Fraction class doesn't implement a square root operation, because most square …

  9. Exponentials in python: x**y vs math.pow(x, y) - Stack Overflow

    Jan 7, 2014 · The math.pow function had (and still has) its strength in engineering applications, but for number theoretical applications, you should use the built-in pow function.

  10. python - How to check for NaN values - Stack Overflow

    A function such as math.isnan will compete very differently when a function is actually required and x != x would need wrapping in a lambda. A numpy functionality such as numpy.isnan will …