prePEP: Decimal data type

John Roth newsgroups at jhrothjr.com
Sat Nov 1 11:25:23 EST 2003


"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:KCQob.78275$e5.2907092 at news1.tin.it...
> John Roth wrote:
>
> > Lots of comments in line. See especially the comment
> > about *NOT* wanting limited precision, as envisioned
> > in the referenced decimal *floating point* standards.
>    ...
> > Since we've got infinite precision integer arithmetic, going to
> > limited precision decimal arithmetic is, IMNSHO, a step backwards.
>
> There may be a niche for a Rational data type, but in MHO it cannot take
the
> place of a limited-precision-decimal (fixed or float).  I suggest you
think
> of a separate PEP to propose Rational (check the existing and rejected
ones
> first, there may be some that are relevant) rather than attacking this
one.

Alex, where did I suggest that I wanted a rational data type? Please
tell me one place in my response where I said that. Please?

For the record. I'm not suggesting a rational data type. I'm quite
well aware of the arguements pro and con, and Guido's position.
Please read what I said without your preconceptions.

The only place where you can get into trouble is with division
and equivalent operations. That's the one place where you actually
need to specify the result number of decimal places and the rounding
policy. Every other operation has a well defined result that won't
ever lead to repeating decimal representations, etc.

My basic suggestion for that is to replace the division operators
with a div() function that lets you specify the number of places
and the rounding policy.

John Roth


>
>
> Alex
>






More information about the Python-list mailing list