granularity (default: 1) will compute left - floor(left/right)*right if the granularity is nonnegative, the output will be any value between 0 and granularity (including 0 but excluding granularity) which is the remainder of the division of a float by float whose quotient is whole. this is essentially a float version of modulo : the remainder can be fractional.