Double variable keeping wrong value

前端 未结 4 2028
长情又很酷
长情又很酷 2021-01-28 02:47

Simimilar problem to Math.Atan2 or class instance problem in C# and add two double given wrong result

It is something that simple lines:

public static S         


        
4条回答
  •  时光取名叫无心
    2021-01-28 03:15

    It could just be a string formatting issue. Try adding the line:

    Debug.Assert(Val == (piBy180 * degree), "WTF?");
    

    after the assignment. It shouldn't fail, since they are both doubles, and arithmetic operations on them should produce the same binary value.

提交回复
热议问题