I don't understand why that doesn't introduce an off-by-one error, but I'm willing to take your word for it that the calculation is correct, and there is no style problem.