range of int() type.

2006-08-23 Thread KraftDiner
What is the range of a variable of type int() eg: i = int() print i.max() # 0x print i.min() # 0x is it a signed 16 bit or 32 bit or is it unsigned 16 or 32... I've noticed that it can be incremented into a new class of type long... --

Re: range of int() type.

2006-08-23 Thread Simon Forman
KraftDiner wrote: What is the range of a variable of type int() eg: i = int() print i.max() # 0x print i.min() # 0x is it a signed 16 bit or 32 bit or is it unsigned 16 or 32... I've noticed that it can be incremented into a new class of type long... | import sys |

Re: range of int() type.

2006-08-23 Thread KraftDiner
Simon Forman wrote: KraftDiner wrote: What is the range of a variable of type int() eg: i = int() print i.max() # 0x print i.min() # 0x is it a signed 16 bit or 32 bit or is it unsigned 16 or 32... I've noticed that it can be incremented into a new class of

Re: range of int() type.

2006-08-23 Thread Gabriel Genellina
At Wednesday 23/8/2006 18:53, KraftDiner wrote: | import sys | sys.maxint 2147483647 So what type / class should one use to represent a 16 bit integers (signed or unsigned)? Plain int. If you need the overflow at 32K/64K, try: x 0x Gabriel Genellina Softlab SRL

Re: range of int() type.

2006-08-23 Thread Terry Reedy
KraftDiner [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] So what type / class should one use to represent a 16 bit integers (signed or unsigned)? For most purposes, Python just has integers, with 'small' ones (depending on the machine) handled more efficiently. For special

Re: range of int() type.

2006-08-23 Thread KraftDiner
Terry Reedy wrote: KraftDiner [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] So what type / class should one use to represent a 16 bit integers (signed or unsigned)? For most purposes, Python just has integers, with 'small' ones (depending on the machine) handled more

Re: range of int() type.

2006-08-23 Thread Felipe Almeida Lessa
23 Aug 2006 17:28:48 -0700, KraftDiner [EMAIL PROTECTED]: This is obvious... but how do I crop off the high order bits if necessary? a[0]0x ? min(a[0], 0x) ? -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list