[Python-Dev] RE: Adding decimal (aka FixedPoint) numbers to Python

Greg Ewing greg@cosc.canterbury.ac.nz
Wed, 18 Dec 2002 10:42:04 +1300 (NZDT)


Tim Peters <tim.one@comcast.net>:

> under FixedPoint's unusual "unbounded
> before the decimal point, fixed # of digits after, and when mixing precision
> the result gets the larger of the input precisions" rules, all of the
> following are always exact operations:
> 
>     + - *

This is true for + and -, but not * -- you need the
sum of the input precisions to avoid losing information
in that case.

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