About 82,700 results
Open links in new tab
  1. How do I calculate square root in Python? - Stack Overflow

    Jan 20, 2022 · How to find integer nth roots? Is there a short-hand for nth root of x in Python? Difference between ** (1/2), math.sqrt and cmath.sqrt? Why is math.sqrt () incorrect for large …

  2. How to perform square root without using math module?

    Jun 15, 2010 · I want to find the square root of a number without using the math module,as i need to call the function some 20k times and dont want to slow down the execution by linking to the …

  3. performance - Which is faster in Python: x**.5 or math.sqrt (x ...

    In python 2.6 the (float).__pow__() function uses the C pow() function and the math.sqrt() functions uses the C sqrt() function. In glibc compiler the implementation of pow(x,y) is quite …

  4. math - Integer square root in python - Stack Overflow

    Mar 13, 2013 · In case anyone visits this page in the future, the python module gmpy2 is designed to work with very large inputs, and includes among other things an integer square root function.

  5. Exponentiation in Python - should I prefer - Stack Overflow

    64 math.sqrt is the C implementation of square root and is therefore different from using the ** operator which implements Python's built-in pow function. Thus, using math.sqrt actually gives …

  6. How is the square root function implemented? - Stack Overflow

    Feb 4, 2016 · Implementation in Python: The floor of the root value is the output of this function. Example: The square root of 8 is 2.82842..., this function will give output '2'

  7. Math module sqrt function python - Stack Overflow

    May 15, 2020 · Write a code segment that only imports sqrt from the math module. The code then prints out the square root for 81 and 9 respectively using the sqrt function math.sqrt(81)

  8. Python- Square Root of list - Stack Overflow

    Mar 23, 2022 · Taking the square root of each number in a list. For this problem in the sqrt_list function: Take the square root of each item in the list, Store each squared item in another list, …

  9. Is there a short-hand for nth root of x in Python? - Stack Overflow

    There is. It's just ** =) Any nth root is an exponentiation by 1/n, so to get the square root of 9, you use 9**(1/2) (or 9**0.5) to get the cube root, you use 9 ** (1/3) (which we can't write with a …

  10. python - Sqrt is undefined, not sure why - Stack Overflow

    Jul 17, 2021 · math.sqrt pow() and abs() are predefined functions in python but sqrt is not predefined in python. Alternatively, you can use pow(N, 1/2) as it is equivalent to sqrt(N)