MCPcopy Create free account
hub / github.com/FastLED/FastLED / fmod_impl_float

Function fmod_impl_float

src/fl/math/math.cpp.hpp:401–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399#pragma pop_macro("round")
400
401float fmod_impl_float(float x, float y) {
402#if FL_MATH_USE_LIBM
403 return ::fmodf(x, y);
404#else
405 if (y == 0.0f) return 0.0f;
406 const float q = x / y;
407 // Truncate toward zero (libm fmod convention).
408 const float t = q >= 0.0f ? floor_impl_float(q) : ceil_impl_float(q);
409 return x - t * y;
410#endif
411}
412
413double fmod_impl_double(double x, double y) {
414#if FL_MATH_USE_LIBM

Callers 2

fmodfFunction · 0.85
fmodFunction · 0.85

Calls 3

fmodfFunction · 0.85
floor_impl_floatFunction · 0.85
ceil_impl_floatFunction · 0.85

Tested by

no test coverage detected