You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you calculate a/23, the result is the approximate float 2.659090889061502e+18 instead of the exact integer result 2659090889061502012. Converting to an int gives you a result which is too small:
py> a = 11**19
py> a - (a//23)*23 # calculate modulus with no rounding error
15
py> a - int(a/23)*23 # introduces rounding error
1395
py> a/23
2.659090889061502e+18
py> int(a/23)
2659090889061501952
py> int(a/23) - a//23
-60
By the way, are you aware of the third argument to pow()?
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: