How to get rid of minus sign from signed zero

前端 未结 6 510
心在旅途
心在旅途 2021-01-13 05:19

I am using asin to calculate the angle. The code is as below :

double FindAngle(const double theValue)
{
     return asin(theValue);
}

Find

6条回答
  •  梦毁少年i
    2021-01-13 06:04

    You can use the following method.

     value = Float.compare(value, -0.0f) == 0 ? 0.0f : value ;
    

提交回复
热议问题