VVVV rounding in c#

Is this function already defined somewhere?

private int VVVVRound(int i, int count)
		{
			if (count == 0)
				return -1;

			if (i < 0)
				i = count - ((-i) % count);
			else if (i >= count)
				i = i % count;

			return i;
		}

yes. have a look at ZMod in VVVV.Utils.VMath

Cheeers!.. no text …

but why would you call this rounding? its a modulo…

@tonfilm - standard modulo works differently for negative values.