I have this code line in VB:
Dim Sqrt As Double
Sqrt = Radius ^ 2 - (CenterX - X) ^ 2
The parameters in the statement above are being passed the values below:
X= -7.3725025845036161 Double
CenterX =0.0 Double
Radius= 8.0 Double
On executing the statement above, the value of Sqrt
is below:
Sqrt 9.646205641487505 Double
Now I wrote a similar C# logic using the Math
class:
double Sqrt = 0;
Sqrt = Math.Pow(Radius, 2) - Math.Pow((CenterX - X), 2);
with the same set of values, the output in C#
code was:
Sqrt 9.6462056414874979 double
I need help because of this single change in C# code, all my values are getting affected. Is there anything I can do to get the similar value as of the *VB*
source?
9.64620564148759
... gotta love floating point math. – Judicator9.6462056414875
. So basically the same. – Gambeson