__builtin__.long¶
-
class
__builtin__.long¶ long(x, base=10) -> long
Convert a number or string to a long integer, or return 0L if no arguments are given. If x is floating point, the conversion truncates towards zero.
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) 4L
Methods¶
__format__ |
|
__getnewargs__ |
|
__new__((S, ...) |
|
__reduce__ |
helper for pickle |
__reduce_ex__ |
helper for pickle |
__sizeof__ |
Returns size in memory, in bytes |
__subclasshook__ |
Abstract classes can override this to customize issubclass(). |
__trunc__ |
Truncating an Integral returns itself. |
bit_length(() -> int or long) |
Number of bits necessary to represent self in binary. |
conjugate |
Returns self, the complex conjugate of any long. |
Attributes¶
denominator |
the denominator of a rational number in lowest terms |
imag |
the imaginary part of a complex number |
numerator |
the numerator of a rational number in lowest terms |
real |
the real part of a complex number |