[Numpy-discussion] fixed_pt prototype using aggregation

Charles R Harris charlesr.harris at gmail.com
Tue Sep 29 20:56:17 EDT 2009


On Tue, Sep 29, 2009 at 4:50 PM, Neal Becker <ndbecker2 at gmail.com> 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
http://docs.python.org/library/decimal.html .

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090929/0d848eef/attachment.html>


More information about the NumPy-Discussion mailing list