mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
* fix(mathlib): correct MedianFilter comparator to satisfy strict-weak ordering - Add explicit NaN handling before comparison operators - NaN sorted to high end, ensuring finite values cluster at median index - Guard NaN checks with if constexpr for non-floating-point types - Replace float equality check with < and > to avoid -Wfloat-equal Fixes #25917 * fix(mathlib): remove type_traits dependency in MedianFilter Replace std::is_floating_point_v<T> with a self-contained template specialization to avoid <type_traits> header, which is unavailable on NuttX targets compiled with -nostdinc++. * fixed formating * test(mathlib): add majority-finite and majority-NaN window tests for MedianFilter * Moved structs inside namespace math * clean up * add two more tests --------- Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>