1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

when testing variances for validity dont allow negative variances

This commit is contained in:
Corvus Corax 2013-05-02 20:09:57 +02:00
parent 467b22f294
commit 201eed8d8f

View File

@ -135,7 +135,7 @@ static inline bool invalid_var(float data) {
if ( invalid(data) ) {
return true;
}
if ( fabsf(data) < 1e-15f ) {
if ( data < 1e-15f ) { // var should not be close to zero. And not negative either.
return true;
}
return false;