More useful 32-bit modulus e.g. “Euclidean divide”
Description
This file provides three different consistent divide/mod pairs
implemented on top of arbitrary C/C++ division, including correct
handling of overflow of intermediate calculations:
trunc: a/b truncates to 0, a%b has same sign as a
floor: a/b truncates to -inf, a%b has same sign as b
eucl: a/b truncates to sign(b)*inf, a%b is non-negative