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

Function eucDivMod

include/math.hpp:67–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67inline void eucDivMod(int a, int b, int* div, int* mod) {
68 *div = a / b;
69 *mod = a % b;
70 if (*mod < 0) {
71 *div -= 1;
72 *mod += b;
73 }
74}
75
76/** Returns `floor(log_2(n))`, or 0 if `n == 1`. */
77inline int log2(int n) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected