Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-05-10 18:03:01


----- Original Message -----
From: John Max Skaller <skaller_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, May 10, 2001 7:44 PM
Subject: Re: [boost] Fixed-Point Decimal Interface

> Bill Seymour wrote:
> [parts ommited]

> 2. The arguments of a multiplication can be any scale n and m,
> the result has scale n+m
>
Notice that this implies that there can't be a maximun scale.
Otherwise multiplications might behave differently.
For instance, suppose we have a maximun scale of 18,
then decimal<5>*decimal<5>=decimal<10>, but
decimal<10>*decimal<10> would be decimal<18>, not decimal<20>.
I think we shouldn't allow this inconsistent behaviour.

> 3. Operator*= requires the argument to have scale 0
>
> 4. Quotient. The argument have the same scale,
> the result has scale 0
>
Please clarify this.

>
> OPINION: All the non-assignment operations should be functions,
> NOT members. NEVER use members for functional operations.
>
I second this. In particular, I would remove the div() member function.

> OPINION: All arguments (except the copy ctor) should use pass by value.
> Its much faster to pass an 'int' than to pass a pointer.
This is platform depedent, and in fact in most modern processors it is
exactly the same.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk