[Python-Dev] Re: Re: Decimal type question [Prothon]

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Aug 10 04:00:55 CEST 2004


> I have been assuming that there is a fundamental need for an integer
> type that has no fraction.  There are many places like indexing
> where you semantically want integers.

That doesn't necessarily mean you need an integer *type*.  Indexing
code can still reject numbers whose value isn't an integer.

There may be other reasons for wanting an integer type, though. For
instance, allowing integers to become abitrarily large doesn't usually
cause any problem, whereas allowing the precision of fractional
numbers to increase unboundedly can lead to unexpectedly high memory
consumption and slowness.  So you probably want arbitrary precision
integers, but not arbitrary precision fractional numbers (at least by
default).

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list