forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP_Math: fix loss of precision on float addition
When using wrap_180_cd() we are adding a small float (180 * 100) to a possibly big number. This may lose float precision as illustrated by the unit test failing: OUT: ../../libraries/AP_Math/tests/test_math.cpp:195: Failure OUT: Value of: wrap_180_cd(-3600000000.f) OUT: Actual: -80 OUT: Expected: 0.f OUT: Which is: 0
- Loading branch information
1 parent
76362ca
commit 880f130
Showing
2 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters