Comment

Comment by gvx

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)

parent gvx 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton