Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-05-10 12:23:29


From: "Bill Seymour" <bsey_at_[hidden]>

> One discussion I'd like to have is about the type of the
> result of arithmetic operations. Using multiplication
> as an example:
>
> template<int Scale1, int Scale2>
> decimal<???>
> operator*(const decimal<Scale1>&, const decimal<Scale2>&);
>
> should ??? be Scale1 (as I have it now) or Scale1 + Scale2?

In the case of operator+, max(Scale1, Scale2).

As for op*. What do you get when you multiply $2.04 and $4.11? :-)

--
Peter Dimov
Multi Media Ltd.

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