mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Multiplication test: fix division resulting in NAN
This commit is contained in:
parent
3747232724
commit
b0b7d7229a
@ -27,7 +27,17 @@ int main()
|
||||
Matrix3f C_check = eye<float, 3>()*2;
|
||||
TEST(isEqual(B, B_check));
|
||||
Matrix3f C = B_check.edivide(C_check);
|
||||
TEST(isEqual(C, C_check));
|
||||
|
||||
// off diagonal are NANs because division by 0
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
for (size_t j = 0; j < 3; j++) {
|
||||
if (i == j) {
|
||||
TEST(isEqualF(C(i,j), 2.f));
|
||||
} else {
|
||||
TEST(isnan(C(i,j)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test non-square matrix
|
||||
float data_43[12] = {1,3,2,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user