On Jan 4, 2:32 am, David Kirkby <david.kir...@onetel.net> wrote:
> > Anyway, the following non-ctypes-code should do the same thing:
>
> > #!/usr/bin/env python
>
> > import sys
> > if sys.maxint > 2**32:
> >    print "64"
> > else:
> >    print "32"
>
> >  -- William
>
> Thanks. I used to work on a Bruker NMR spectrometer. You code would
> have failed on that, as it was 24-bits. It was neither big endian or
> little endian, as either the most (or least, I foget which)
> significant byte was in the middle!!

How about using this?

#!/usr/bin/env python

import sys
b = 1
x = sys.maxint

while x:
    x = x >> 1
    b = b+1

print(b)


Cheers
J

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to