The numerical limitations of python are available in the sys module , for example, any of them:
sys.float_info is a named floating point constraint tuple for your platform. Floating-point numbers consist of exponent and precision; you must be more precise about what you mean by the largest number here; the number with the highest score and the full accuracy of using sys.float_info.max .
sys.int_info ; not so much restrictions as implementation details; you should be able to evaluate the largest integer possible from this. Python integers are limited only by your available memory.
sys.maxsize ; platform word size and restriction of lists and tuples, etc.
So, for integers there is basically a soft limit on the maximum and minimum values. It depends on how much memory your process can use, and how much memory your process already uses for other purposes.
In Python 3, there is no longer a separate long type, but in Python 2 sys.maxsize + 1 should be long , as well as -sys.maxsize - 2 . Between these two extremes lies the range of possible βshortβ integers.
For complex numbers, the ordering is a bit more .... anyway. Complex numbers have real and imaginary components, both are floats. Guess what? These are the python plugins, and you already have the limits information above:
>>> type(1j) <type 'complex'> >>> type(1j.real) <type 'float'> >>> type(1j.imag) <type 'float'>
source share