3 ms·
I need to correct myself: on my 64 bit system, given M = ((1 << (30 * N)) - 1, M is the largest integer such that sys.getsizeof(M) = 24 + 4 * N. Assuming I mad
by gvx 6y ago
I need to correct myself: on my 64 bit system, given M = ((1 << (30 * N)) - 1, M is the largest integer such that sys.getsizeof(M) = 24 + 4 * N.
Assuming I made no further mistakes, sys.getsizeof(I) <= sys.maxsize for any I, which implies that the largest representable integer in Python is (1 << (30 * Nmax)) - 1, where Nmax = (sys.maxsize - 24) // 4 = 2305843009213693945, so the actual maximum integer is (1 << 69175290276410818350) - 1 which is approximately 10 ** 2.082383733196259e+19 (for comparison, 10 ** sys.maxsize is approximately 10 ** 9.223372036854776e+18)
- karroum 6y agoThank you for your clarification/correction ! I'll update the article.