3 ms·
See std::fmod and std::remainer: https://en.cppreference.com/w/cpp/numeric/math/fmod https://en.cppreference.com/w/cpp/numeric/math/fmod https://en.cppreferen
by MauranKilom 5y ago
See std::fmod and std::remainer:
https://en.cppreference.com/w/cpp/numeric/math/fmod https://en.cppreference.com/w/cpp/numeric/math/fmod
https://en.cppreference.com/w/cpp/numeric/math/remainder https://en.cppreference.com/w/cpp/numeric/math/remainder
A valid use may be when approximating a periodic function via a polynomial (e.g. sin/cos), where you will want to first perform range reduction like std::fmod(x, 2 * pi).