给出等式 - > (指数+旋转)%腐= F;如果我知道f,旋转,腐烂的值 什么是计算指数的公式。我在数学方面不是很好,但我想知道在我的编程中计算索引。
答案 0 :(得分:0)
(指数+旋转)%rot = f
装置
index + rotation = rot*k + f, k is an integer (.., -2, -1, 0, 1, 2,..)
因此
index = rot*k + f - rotation, k: integer
如果您想index > 0
,请务必选择k > (rotation - f) / rot