Answer the question
In order to leave comments, you need to log in
Rounding during integer division, how to understand?
Task
Answer the question
In order to leave comments, you need to log in
Let n = pk + d, where 1 <= d <= p
Then ⌈n/k⌉ = p + 1
n + k - 1 = pk + d + k - 1 = (p + 1)k + (d - 1 )
⌊(n+k−1)/k⌋ = ⌊p + 1 + (d - 1)/k⌋ = p + 1, because 0 <= d - 1 < k
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question