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

    Jan 20, 2022 · Arbitrary precision square root. This variation uses string manipulations to convert a string which represents a decimal floating-point number to an int, calls math.isqrt to do the …

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

    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 simpler fraction), …

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

    This is simply a question of how the underlying code actually works. What is the theory of how Python code works? I sent Guido van Rossum an email cause I really wanted to know the …

  4. Why does Python give the "wrong" answer for square root? What …

    This behavior is "normal" in Python 2.x, whereas in Python 3.x 1/2 evaluates to 0.5. If you want your Python 2.x code to behave like 3.x w.r.t. division write from __future__ import division - …

  5. Square root of complex numbers in python - Stack Overflow

    Both answers (+0.5j and -0.5j) are correct, since they are complex conjugates-- i.e. the real part is identical, and the imaginary part is sign-flipped.

  6. square root - Python sqrt limit for very large numbers ... - Stack …

    Jan 31, 2015 · Python handles ridiculously large integer numbers without problems. For floating point numbers, it uses standard (C) conventions, and limits itself to 64 bit precision. You …

  7. square root of a number greater than 10^2000 in Python 3

    Dec 17, 2017 · The usual square root methods convert the parameter to a float value before doing the calculation. As you saw, this does not work well with very large integers. So use a function …

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

    Jun 15, 2010 · Note that the timing tests calculate the square root of a variable. They do not calculate a constant like 2**0.5, because 2**0.5 is pre-calculated, in CPython: import dis def …

  9. Writing your own square root function - Stack Overflow

    Oct 26, 2009 · This square root is the first digit of your final answer. Lets denote the digits we have already found of our final square root as B. So at the moment B = 2. 2) Next compute the …

  10. python - Loop Function to find a Square root of a number - Stack …

    Sep 17, 2018 · Using the Babylonian Method means solving (S^2 - V) = 0. Here, S is the square root of V, which is to be found. Applying Newtons Approximation leads to an iterative method …

Refresh