About 4,780,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. python - How do you get the magnitude of a vector in Numpy?

    Feb 7, 2012 · 254 In keeping with the "There's only one obvious way to do it", how do you get the magnitude of a vector (1D array) in Numpy? def mag(x): return math.sqrt(sum(i**2 for i in x)) …

  6. 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 …

  7. python - Solving Quadratic Equation - Stack Overflow

    Continue to help good content that is interesting, well-researched, and useful, rise to the top! To gain full voting privileges,

  8. 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 …

  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. Is there an operator to calculate percentage in Python?

    Jul 31, 2018 · 81 I've recently learned that the " % " sign is used to calculate the remainder of an integer in Python. However I was unable to determine if there's another operator or method to …