Well, the answer to your question is usually not, however, if you are dealing with large numbers, you may have some problems, the details of python large numbers are given below.
Also see this post for information on inf (infinity) NaN (not a number (i.e. infinity / infinity = NaN))
Please note: this is on a 32bit AMD machine (although python says it is Intel (does that mean it is 32bit?)
Python 2.6.2 (r262: 71605, April 14, 2009, 10:40:02 PM) [MSC v.1500 32 bit (Intel)] on win32
The maximum number of CPython in its math module (below C lib), where otherwise it will overflow or return inf - 8.2184074615549724e + 309
>>> x = 8.2184074615549724e+309 >>> x 8.2184074615549724e+309 >>> x + 1 >>> x inf >>> x = exp(710) Traceback (most recent call last): File "<stdin>", line 1, in <module> OverflowError: math range error
The maximum number (python can represent) is 1.7976931348623157e + 308 and can be obtained (possibly in other ways)
http://docs.scipy.org/doc/numpy/reference/generated/numpy.finfo.html
>>> import numpy >>> f = numpy.finfo(float() >>> f.max 1.7976931348623157e+308 >>> m = f.max >>> m1 = m + 100
I believe (but don't know) that this is due to the mathematical use of the C base library http://docs.python.org/library/math.html
Specifically for CPython The mathematical module consists mainly of thin wrappers around the mathematical function of platform C. Behavior in exceptional cases follows Appendix F of standard C99, where appropriate. An electric current implementation will raise a ValueError for invalid operations such as sqrt (-1.0) or log (0,0) (where C99 Appendix F recommends signaling an invalid operation or divide by zero) and OverflowError for results that overflow (for example, exp ( 1000,0))
Changed in version 2.6: Behavior in special cases is now aimed at following C99 Appendix F. In earlier versions of Python, behavior in special cases was poorly specified. It is obvious.
The maximum Python integer (type int) is determined by sys.maxint. The difference between the maximum integer and the maximum number is
>>> type(x) <type 'float'> >>> int_x = int(x) >>> type(int_x) <type 'long'> >>>
The maximum number is initially a float, but when we try to convert it to an integer using the int () function, it is automatically converted to type long because it exceeds sys.maxintloosely.