MCPcopy Create free account
hub / github.com/VCVRack/Rack / eucDiv

Function eucDiv

include/math.hpp:58–65  ·  view source on GitHub ↗

Euclidean division. `b` must be positive. */

Source from the content-addressed store, hash-verified

56`b` must be positive.
57*/
58inline int eucDiv(int a, int b) {
59 int div = a / b;
60 int mod = a % b;
61 if (mod < 0) {
62 div -= 1;
63 }
64 return div;
65}
66
67inline void eucDivMod(int a, int b, int* div, int* mod) {
68 *div = a / b;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected