Note: The (corrected) expression for M
builds a mask with the low-order n
bit(s) set, assuming that that the type of integers has at least (and including) n
bits. The &M
insures that variables stay within n
bits. If variables have exactly n
bits (e.g. in C uint32_t
variables with n = 32
), we can do without M
and &M
. If variables have some fixed width larger than n
, we can deffer the &M
to the return step.