In this particular case the problem is due more to m
than s(n)
. When computing m % s(n)
, since s(n)
is a float, m
is coerced to a float. But -- float(m)
loses precision. The clearest way to see this is that
m == 100000000000006340
but
int(float(m)) == 100000000000006336
Note that 100000000000006336 % 50116242483153 == 18096246116101
, which shows where the mystery value comes from.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…