This should be doable without floating-point math. Something like `let (n, r) = (index - b).div_rem(a)`