[CentralOH] Python bit size

Mark Erbaugh mark at microenh.com
Wed May 11 01:03:09 CEST 2011



Sent from my iPad

On May 10, 2011, at 3:45 PM, Eric Floehr <eric at intellovations.com> wrote:

> I think your answer is right there (sys.maxint):
> 
> def bits():
>     import sys
>     x = sys.maxint
>     n = 1
>     while x:
>         n += 1
>         x >>= 1
>     return n
> 
> -Eric

Is that always guaranteed that the size of an int is the sizeof the Python bits?

Mark


More information about the CentralOH mailing list