maximum value for long?
forth at gmx.de
Tue Nov 18 18:06:23 CET 2003
I have been programming in Python only for a month or so and have stumbled
over a "problem" that I could not solve through rtfm.
Python 2.2.2 (#1, Nov 6 2003, 09:19:47)
[GCC 3.3] on irix646
Type "help", "copyright", "credits" or "license" for more information.
>>> print ulong_max
>>> print very_long_long
>>> print result
I have set ulong_max above to the C compilers ULONG_MAX definition from limits.h
I would have expected Python to complain when setting the value of the variable
very_long_long to anything greater than ULONG_MAX.
Since I am currently doing computations with integer values *much* bigger than
ULONG_MAX, this behaviour suites me, but I am wondering if this is a "standard"
Python behaviour since I do not want my scripts to become dependant on some
obscure non-standard feature...
Could any kind Python-Guru please shed some light on this?
Also, if Python really can handle longs that are bigger than the machines native
longs, the interpreter has to do some sort of arbitrary precision math
somewhere. Could you please point me to the according interpreter's source file(s)?
TIA + Regards,
More information about the Python-list