
How do I calculate square root in Python? - Stack Overflow
Jan 20, 2022 · I need to calculate the square root of some numbers, for example √9 = 3 and √2 = 1.4142. How can I do it in Python? The inputs will probably be all positive integers, and …
Is there a short-hand for nth root of x in Python? - Stack Overflow
In Python this operation seems to be represented by the ** syntax. >>> 3**2 9 If I want to go the other direction and calculate the 2nd root of 9 then in maths I need to use a symbol: 2√9 = 3 Is …
Why does Python give the "wrong" answer for square root? What …
It's not wrong, it's the right answer to a different question. If you want to calculate the square root without an import of the math module, you'll need to use x**(1.0/2) or x**(1/2.). One of the …
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 …
How do I root in python (other than square root)? [duplicate]
Jan 6, 2019 · I'm trying to make a calculator in python, so when you type x (root) y it will give you the x root of y, e.g. 4 (root) 625 = 5. I'm aware of how to do math.sqrt () but is there a way to …
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 …
The fourth root of (12) or any other number in Python 3
Sep 6, 2013 · In math, 12؇4 is the 12th root of 4, not the 4th root of 12. In other words, it's the inverse of 4 ** 12, not the inverse of 12 ** 4. Which one do you actually want?
Square root of a number without math.sqrt - Stack Overflow
Jul 17, 2017 · Why don't you want to use math.sqrt or one-half power? I see two main reasons to avoid that:when you need more precision than the 15-17 significant digits that math.sqrt and …
square root function on Python using Spyder - Stack Overflow
Mar 11, 2024 · I'm just starting out using both Python under Spyder. I was about to do a simple square root calculation. I see that in Python, you need to do an "import math". I did …
How to find cube root using Python? - Stack Overflow
Jan 18, 2015 · This takes the cube root of x, rounds it to the nearest integer, raises to the third power, and finally checks whether the result equals x. The reason to take the absolute value is …