Using the Math package (in different programming languages) method sqrt to calculate the square root of a value.
Questions tagged [math.sqrt]
77 questions
-6
votes
4 answers
Square root of number python
Here's my code:
import cmath
root = (cmath.sqrt(25))
print (root)
raw_input()
The problem i face is the result of root is 5+0j which is undesirable i only want the square root. How can i fix this?

user2151341
- 47
- 2
- 3
- 5
-14
votes
2 answers
C# - Math.Sqrt() returning decimals
Is there a way in C# for returning a square root of a number with decimals.
Every time I use Math.Sqrt() it doesn't return a decimal.
My code:
Int32 a = Convert.ToInt32(input1.Text);
Int32 b = Convert.ToInt32(input2.Text);
//a*a +…
user4167344