| 370 | } |
| 371 | |
| 372 | long lround_impl_double(double value) { |
| 373 | #if FL_MATH_USE_LIBM |
| 374 | return ::lround(value); |
| 375 | #else |
| 376 | if (value >= 0.0) return static_cast<long>(value + 0.5); |
| 377 | return static_cast<long>(value - 0.5); |
| 378 | #endif |
| 379 | } |
| 380 | |
| 381 | // Arduino.h defines `round` as a macro, so we temporarily hide it. |
| 382 | #pragma push_macro("round") |
no test coverage detected