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

Function eucMod

include/math.hpp:47–53  ·  view source on GitHub ↗

Euclidean modulus. Always returns `0 <= mod < b`. `b` must be positive. See https://en.wikipedia.org/wiki/Euclidean_division */

Source from the content-addressed store, hash-verified

45See https://en.wikipedia.org/wiki/Euclidean_division
46*/
47inline int eucMod(int a, int b) {
48 int mod = a % b;
49 if (mod < 0) {
50 mod += b;
51 }
52 return mod;
53}
54
55/** Euclidean division.
56`b` must be positive.

Callers 6

advanceTipMethod · 0.85
drawMethod · 0.85
onDragMoveMethod · 0.85
eucmodFunction · 0.85
eucmodiFunction · 0.85
eucmodfFunction · 0.85

Calls 1

fmodFunction · 0.85

Tested by

no test coverage detected