这是我的问题(C#):
double Y = 0.0;
double X = -21.0;
double q1_Test = Math.Atan2(0.0, -21.0); // gives Math.Pi
double q1_Test2 = Math.Atan2(( double)Y, (double)X); // gives Math.Pi
double w1 = <SomeclassInstanceGlobalHere>.getW1(); // This is a class which updates a variable
double w2 = <SomeclassInstanceGlobalHere>.getW2(); // This is a class which updates a variable
double q1 = Math.Atan2(w2, w1); // ** gives -Math.Pi ** ???
//w2 shows 0.0 and w1 shows -21.0
当我从另一个类中获取值时,变量值分别为 0.0 和 -21.0。它还在调试时显示在 IDE 中。这里出了什么问题?