Python data type int

Source: Internet
Author: User

"Number

int (integral type)

On a 32-bit machine, the number of integers is 32 bits and the value range is -2**31~2**31-1, which is -2147483648~2147483647
On a 64-bit system, the number of integers is 64 bits and the value range is -2**63~2**63-1, which is -9223372036854775808~9223372036854775807

Class int (object):     "" "    int (x=0)  -> int or  long    int (x, base=10)  -> int or long         convert a number or string to an integer,  or return 0 if no arguments    are given.   If x is floating point, the conversion truncates towards zero.     If x is outside the integer range, the  Function returns a long instead.        if x  is not a number or if base is given, then x must  be a string or    Unicode object representing an  Integer literal in the given base.  the    literal can be preceded  by  ' + '  or  '-'  and be surrounded by whitespace.     The base defaults to 10.  Valid bases are 0 and  2-36.  base 0 means to    interpret the base from  the string as an integer literal.    >>> int ( ' 0b100 ',  base=0)      "" "    def bit_length (self):           ""   returns the minimum number of digits used to represent the number   ""           "" "        int.bit_length ()  -> int                 number of  bits necessAry to represent self in binary.        > >> bin (Panax Notoginseng)          ' 0b100101 '          >>>  (PNS). Bit_length ()          "" "         return 0    def conjugate (self, * Args, **kwargs): # real signature unknown          ""   return the complex's conjugate complex number   "" "        " ""  returns self,  the complex conjugate of any int.  "" "         pass    def __abs__ (self):          ""   return absolute value   "" "        " ""  x.__abs__ ()  <== > abs (x)  "" "        pass    def __add__ (self, y):          "" " x.__add__ (y)  <==> x+y " "         pass    def __and__ (self, y):          "" " x.__and__ (y)  <==> x&y " "         pass    def __cmp__ (self, y):           ""   compare two number sizes   ""           "" " x.__cmp__ (y)  <==> cmp (x, y)  " ""          pass    def __coerce__ (self, y):          ""   force generation of a tuple   ""           "" " x.__ coerce__ (y)  <==>&Nbsp;coerce (x, y)   "" "        pass    def  __divmod__ (self, y):          "" "  divide, get quotient and remainder tuple   "" "         " ""  x.__divmod__ (y)  <==>  Divmod (x, y)   "" "        pass    def  __div__ (self, y):          "" " x.__div__ (y)   <==> x/y  "" "        pass    def  __float__ (self):          "" "  convert to floating-point type  " "           "" " x.__float__ ()  <==> float (x)  " ""         pass    def __floordiv__ (self, y ):          "" " x.__floordiv__ (y)  <==> x//y " "         pass    def __format__ (Self, *args, **kwargs) : # real signature unknown        pass     def __getattribute__ (self, name):          " ""  x.__getattribute__ (' name ')  <==> x.name  "" "         pass    def __getnewargs__ (Self, *args, **kwargs): #  real signature unknown         "" "  internal call  __new__ method or create an object when the incoming parameter is used   "" "         pass    def  __hash__ (self):          "" "If the object is a hash table type, returns the hash value of object. The hash value is an integer. In dictionary lookups, hash values are used for fastThe key for a fast comparison dictionary. Two values if equal, the hash value is also equal. ""          "" " x.__hash__ ()  <==> hash (x)  " ""         pass    def __hex__ (self):           ""   returns the current number of   hexadecimal   means   "" "           "" " x.__hex__ ()  <==> hex (x)  " ""          pass    def __index__ (self):           ""   for slicing, numeric meaningless   "" "          "" " x[y:z] <==> x[y.__index__ (): z.__index__ ()] " ""          pass    def __init__ (self, x, base=10):  #  known special case of int.__init__         "" "  Construction method,Line  x = 123  or  x = int  , auto invoke, temporarily ignore   "" "           "" "        int (x=0)  -> int  or long        int (x, base=10)  -> int  or long                 convert a number or string to an integer, or return 0  if no arguments        are given.  if  x is floating point, the conversion truncates towards zero.         If x is outside the integer  range, the function returns a long instead.            &nBsp;    if x is not a number or if base is  given, then x must be a string or         Unicode object representing an integer literal in the  given base.  the        literal can be  preceded by  ' + '  or  '-'  and be surrounded by whitespace.         The base defaults to 10.  Valid  bases are 0 and 2-36.  base 0 means to         interpret the base from the string as an  Integer literal.        >>> int (' 0b100 ',  base= 0)         #  (Copied from class doc)           "" "        pass    def __int__ (self):           ""   Convert to Integer   ""            "" " x.__int__ ()  <==> int (x)  " ""          pass    def __invert__ (self):           "" " x.__invert__ ()  <==> ~x " "         pass    def __long__ (self):           ""   Convert to Long integer   ""           "" " x.__ long__ ()  <==> long (x)   "" "        pass     def __lshift__(self, y):          "" " x.__lshift__ (y)  <==>  x<<y  "" "        pass    def  __mod__ (self, y):          "" " x.__mod__ (y)  <== > x%y  "" "        pass    def __ mul__ (self, y):          "" " x.__mul__ (y)  <== > x*y  "" "        pass    def __ Neg__ (self):          "" " x.__neg__ ()  <==> -x   ""         pass     @staticmethod  #  known case of __new__    def __new__ (S, *more):           "" " t.__new__ (s,  ...)  -> a new object with type S, a subtype of T  "" "        pass    def __nonzero__ (self):           "" " x.__nonzero__ ()  <==> x != 0   "" "        pass    def __oct__ (self):           ""   Return to change   octal   =   "" "           "" " x.__oct__ ()  <==> oct (x)  " ""          pass    def __or__ (self, y):           "" " x.__or__ (y)  <==> x|y " "         pass    def __pos__(self):          "" " x.__pos__ ()  <==> +x   "" "        pass    def __pow__ (Self,  y, z=none):          "" "  power, sub-square  " "           "" " x.__pow__ (Y[, z])  <==> pow (x, y[, &NBSP;Z])   ""         pass    def __radd_ _ (Self, y):          "" " x.__radd__ (y)  <==>  y+x  "" "        pass    def __rand_ _ (Self, y):          "" " x.__rand__ (y)  <==>  y&x  "" "        pass    def __ rdivmod__ (Self, y):          "" " x.__rdivmod__ (y)  <==> divmod (y ,  x)   "" "        pass    def __rdiv_ _ (Self, y):          "" " x.__rdiv__ (y)  <==>  y/x  "" "        pass    def __repr_ _ (self):          "" "translates to the readable form of the interpreter  " ""           "" " x.__repr__ ()  <==> repr (x)  " ""          pass    def __str__ (self):           "" "to the form of human reading, if there is no suitable for people to read the form of interpretation, then return to the form of the Interpreter class reading" ""           "" " x.__str__ ()  <==> str (x)  " ""          pass    def __rfloordiv__ (self, y):          "" "  x.__rfloordiv__ (y)  <==> y//x  "" "        pass     def __rlshift__ (self, y):           "" " x.__rlshift__ (y)  <==> y<<x " "         pass    def __rmod__ (self, y):           "" " x.__rmod__ (y)  <==> y%x " "         pass    def __rmul__ (self, y):           "" " x.__rmul__ (y)  <==> y*x " "         pass    def __ror__ (self, y):           "" " x.__ror__ (y)  <==> y|x  "" "        pass     def __rpow__ (Self, x, z=none):           "" " y.__rpow__ (X[, z])  <==> pow (X, y[, z])  " ""          pass    def __rrshift__ (self, y):           "" " x.__rrshift__ (y)  <==> y>>x   "" "        pass    def __rshift__ (Self,  y):          "" " x.__rshift__ (y)  <==> x >>y  "" "        pass    def __rsub_ _ (Self, y):          "" " x.__rsub__ (y)  <==>  y-x  "" "&NBSP;&NBSP;&Nbsp;     pass    def __rtruediv__ (self, y):           "" " x.__rtruediv__ (y)  <==> y/x " "         pass    def __rxor__ (self, y):           "" " x.__rxor__ (y)  <==> y^x " "         pass    def __sub__ (self, y):           "" " x.__sub__ (y)  <==> x-y " "         pass    def __truediv__ (self, y):           "" " x.__truediv__ (y)  <==> x/y  "" "        pass    def __trunc__ (self, * Args, **kwargs): &Nbsp;         "" "  return value is truncated to shaping values, no meaning in shaping  " ""          pass    def __xor__ (self, y):           "" " x.__xor__ (y)  <==> x^y " "         pass    denominator = property (lambda self:  object (),  lambda self, v: none, lambda self: none)   #  default     ""   Denominator  = 1  "" "    " "the  Denominator of a rational number in lowest terms "" "     Imag = property (Lambda self: object (), lambda self, v: none,  Lambda self: none)   # default     ""   imaginary, meaningless   "" "      "" "The imaGinary part of a complex number "" "    numerator =  Property (Lambda self: object (),  lambda self, v: none, lambda self:  none)   # default     "" "  numerator  =  number size  " "      "" "The numerator of a rational number in lowest terms" ""     real = property (Lambda self: object (),  lambda self,  v: none, lambda self: none)   # default     "" "   No meaning   "" "    " "" the real part of a complex  Number "" "Int


Python data type int

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.