У меня есть эта строка кода в VB:
Dim Sqrt As Double
Sqrt = Radius ^ 2 - (CenterX - X) ^ 2
В приведенных выше параметрах передаются следующие значения:
X= -7.3725025845036161 Double
CenterX =0.0 Double
Radius= 8.0 Double
При выполнении вышеприведенного утверждения значение Sqrt
ниже:
Sqrt 9.646205641487505 Double
Теперь я написал аналогичную логику С#, используя класс Math
:
double Sqrt = 0;
Sqrt = Math.Pow(Radius, 2) - Math.Pow((CenterX - X), 2);
с тем же набором значений, вывод в коде C#
:
Sqrt 9.6462056414874979 double
Мне нужна помощь из-за этого единственного изменения в коде С#, все мои значения становятся затронутыми. Есть ли что-нибудь, что я могу сделать, чтобы получить такое же значение, как и источник *VB*
?