[Numpy-discussion] fixed_pt prototype using aggregation
Charles R Harris
Tue Sep 29 19:56:17 CDT 2009
On Tue, Sep 29, 2009 at 4:50 PM, Neal Becker <firstname.lastname@example.org> wrote:
> I have a prototype for fixed_pt without using inheritance. I think I like
> it. Any thoughts?
There is a line 177 characters long ;) Looks like a step in the right
direction, though. If you add the various operations of interest -- mul,
div, add, sub -- to the fixed_pt type you can make object arrays of them
pretty easily. Also, FixedPoint would be a more conformant way of naming the
class. The Decimal class in python 2.6 might be worth looking at, it is in
./Lib/decimal.py if you download the source. A description is at
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion