0
How do I find squareroot of float variable?
In my quest of finding the distance between two points, i couldn't use "^" with float and double.
3 Respuestas
0
You could cast it to double, use https://msdn.microsoft.com/en-us/library/system.math.sqrt(v=vs.110).aspx and recast it to float
0
i can't use ^even in double @sérgio
0
float val = 9.657f;
val = (float)Math.Sqrt((double)val);
Console.WriteLine(val);
You must not be doing it right, cause this works. Avoid the ^ operator alltogether