numeric limits?

David Abrahams david.abrahams at rcn.com
Thu Jun 6 22:15:19 CEST 2002


Is there some straightforward way to find out the range of a Python Int (in
code)?
The best I could do was to probe it using tricks like:

x = 1
while (x << 1) > 0:
    x <<= 1

TIA,
Dave

--
+---------------------------------------------------------------+
                  David Abrahams
      C++ Booster (http://www.boost.org)               O__  ==
      Pythonista (http://www.python.org)              c/ /'_ ==
  resume: http://users.rcn.com/abrahams/resume.html  (*) \(*) ==
          email: david.abrahams at rcn.com
+---------------------------------------------------------------+





More information about the Python-list mailing list