If you are not aware modulo, usually denoted as a %, is a mathematical operation that returns the remainder of division. This is very useful in exploiting some of the properties of integer math.

My need for this comes from a desire to create a faster way to encode a counter’s number into binary. Essentially the only method I’ve discovered currently to do this is to decrement from the decimal counter and add to the least significant bit of my binary counter array.

In this video I demonstrate that encoding binary to decimal is currently orders of magnitude faster than vice versa due to this limitation and provide a cool usecase for faster conversion with my paint board whose size is ultimately limited by this conversion rate:

Edit: For the issue of counters containing floats (which aren’t compatible with modulo), just floor or round the values to turn them into integers.