Steven D'Aprano added the comment:
This is a floating point issue, not a bug. Floats inherently only have a
limited precision available, so they are not always the exact number you think
they are.
Using 1e9 forces the result to be a float, which introduces rounding errors
into the calculati
New submission from wjzbf :
hello python,
when i calculate:
15147666057940416-15147666057940416//17 * (1e9+7)
it returns
67534848.0
when i calculate
15147666057940416 % (1e9+7)
it returns
67536199.0
the two values are not equal.
how to explain it?
tha