Cavan O'Horo 1beb6d70f0
fix(mathlib): correct MedianFilter comparator to satisfy strict-weak … (#26583)
* 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>
2026-02-25 20:55:35 -09:00
..