matrix_alg: use PX4_ISFINITE() instead if isnan() & isinf()

This commit is contained in:
Beat Küng
2017-01-26 15:49:39 +01:00
committed by Lorenz Meier
parent 5c96c8c1b3
commit 1da934049c
+2 -1
View File
@@ -39,6 +39,7 @@
*/
#include "matrix_alg.h"
#include <px4_defines.h>
/*
* Does matrix multiplication of two regular/square matrices
@@ -239,7 +240,7 @@ bool mat_inverse(float *A, float *inv, uint8_t n)
//check sanity of results
for (uint8_t i = 0; i < n; i++) {
for (uint8_t j = 0; j < n; j++) {
if (isnan(inv_pivoted[i * n + j]) || isinf(inv_pivoted[i * n + j])) {
if (!PX4_ISFINITE(inv_pivoted[i * n + j])) {
ret = false;
}
}