- #1
- 27,982
- 19,480
- TL;DR Summary
- Arithmetic error handling large integer in Python
I've written a program to factorise large numbers (although not that large). The following arithmetic operation goes wrong:
x= int(912_321_155_211_368_155/(5))
The result is
182_464_231_042_273_632
Which is clearly not right (should end in 631). The maximum integer on the 64-bit version is supposed to be larger than that.
How do you know when integer arithmetic is getting too large and things start to go wrong?
x= int(912_321_155_211_368_155/(5))
The result is
182_464_231_042_273_632
Which is clearly not right (should end in 631). The maximum integer on the 64-bit version is supposed to be larger than that.
How do you know when integer arithmetic is getting too large and things start to go wrong?
Last edited: