NuttX carry minimal c++ cmath (replacing Matrix stdlib_imports.hpp)

This commit is contained in:
Daniel Agar
2022-07-12 08:05:06 -04:00
parent fe22167512
commit a73efd9c4f
32 changed files with 297 additions and 323 deletions
@@ -31,6 +31,8 @@
*
****************************************************************************/
#include <cmath>
#include <gtest/gtest.h>
#include <ControlMath.hpp>
#include <px4_platform_common/defines.h>
@@ -249,7 +251,7 @@ TEST(ControlMathTest, addIfNotNan)
v = NAN;
// both summands are NAN
ControlMath::addIfNotNan(v, NAN);
EXPECT_TRUE(isnan(v));
EXPECT_TRUE(std::isnan(v));
// regular value gets added to NAN and overwrites it
ControlMath::addIfNotNan(v, 3.f);
EXPECT_EQ(v, 3.f);