diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-02-26 22:46:33 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-02-26 22:46:33 +0400 |
commit | f9619e39341dbc45683c6ccd7e06397f8a537216 (patch) | |
tree | 1419a61ae690811d711dfd926adae2da7f60283b /src/lib/geo/geo.c | |
parent | 2967763b160bb12b8e13e72219fcb689da015ab5 (diff) | |
download | px4-firmware-f9619e39341dbc45683c6ccd7e06397f8a537216.tar.gz px4-firmware-f9619e39341dbc45683c6ccd7e06397f8a537216.tar.bz2 px4-firmware-f9619e39341dbc45683c6ccd7e06397f8a537216.zip |
geo: _wrap_XXX minor fix
Diffstat (limited to 'src/lib/geo/geo.c')
-rw-r--r-- | src/lib/geo/geo.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/geo/geo.c b/src/lib/geo/geo.c index 9b3e202e6..59c04f0e3 100644 --- a/src/lib/geo/geo.c +++ b/src/lib/geo/geo.c @@ -441,14 +441,14 @@ __EXPORT float _wrap_pi(float bearing) } int c = 0; - while (bearing > M_PI_F) { + while (bearing >= M_PI_F) { bearing -= M_TWOPI_F; if (c++ > 3) return NAN; } c = 0; - while (bearing <= -M_PI_F) { + while (bearing < -M_PI_F) { bearing += M_TWOPI_F; if (c++ > 3) return NAN; @@ -465,14 +465,14 @@ __EXPORT float _wrap_2pi(float bearing) } int c = 0; - while (bearing > M_TWOPI_F) { + while (bearing >= M_TWOPI_F) { bearing -= M_TWOPI_F; if (c++ > 3) return NAN; } c = 0; - while (bearing <= 0.0f) { + while (bearing < 0.0f) { bearing += M_TWOPI_F; if (c++ > 3) return NAN; @@ -489,14 +489,14 @@ __EXPORT float _wrap_180(float bearing) } int c = 0; - while (bearing > 180.0f) { + while (bearing >= 180.0f) { bearing -= 360.0f; if (c++ > 3) return NAN; } c = 0; - while (bearing <= -180.0f) { + while (bearing < -180.0f) { bearing += 360.0f; if (c++ > 3) return NAN; @@ -513,14 +513,14 @@ __EXPORT float _wrap_360(float bearing) } int c = 0; - while (bearing > 360.0f) { + while (bearing >= 360.0f) { bearing -= 360.0f; if (c++ > 3) return NAN; } c = 0; - while (bearing <= 0.0f) { + while (bearing < 0.0f) { bearing += 360.0f; if (c++ > 3) return NAN; |