AP_Math: compiler warnings: apply is_zero(float) or is_equal(float)

This commit is contained in:
Tom Pittenger 2015-05-02 02:51:02 -07:00 committed by Andrew Tridgell
parent 98c5137107
commit 6e6f481ecb
1 changed files with 2 additions and 2 deletions

View File

@ -47,11 +47,11 @@ float fast_atan(float v)
// origin source: https://gist.github.com/volkansalma/2972237/raw/ // origin source: https://gist.github.com/volkansalma/2972237/raw/
float fast_atan2(float y, float x) float fast_atan2(float y, float x)
{ {
if (x == 0.0f) { if (AP_Math::is_zero(x)) {
if (y > 0.0f) { if (y > 0.0f) {
return FAST_ATAN2_PIBY2_FLOAT; return FAST_ATAN2_PIBY2_FLOAT;
} }
if (y == 0.0f) { if (AP_Math::is_zero(y)) {
return 0.0f; return 0.0f;
} }
return -FAST_ATAN2_PIBY2_FLOAT; return -FAST_ATAN2_PIBY2_FLOAT;