The smallest and largest values of numeric types

Robert Kern robert.kern at gmail.com
Tue Apr 17 11:12:59 EDT 2007


Lou Pecora wrote:
> In article <QA4Vh.122$Bz6.77 at read3.inet.fi>, tom at finland.com wrote:
> 
>> Hi!
>> How can I determine the smallest and largest values of numeric types 
>> (for example int) possible in my system? I think there exists a function 
>> for this task but I don't know it.
> 
> There is or was a module called "kinds" which was an implementation of 
> PEP  0242.  I have it and it gives the values you are looking for (and 
> more).  But I don't know where I got it.  I think it was once 
> distributed with Macpython on MacPython.org, but I'm not sure.  I've 
> searched for it, but nothing shows up except my own questions about it 
> from many years ago and they have no clues.  

I'm surprised they also didn't turn up my replies to those questions.

> Does anyone know where this package is?  Or what might replace it.  It 
> is very useful.

It used to be distributed with Numeric.

  http://numpy.cvs.sourceforge.net/numpy/kinds/

numpy exposes the same information for floating point types with its finfo
class. Nothing particular for ints.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list