Boost logo

Boost :

From: Andy Sawyer (boost_at_[hidden])
Date: 1999-12-04 22:13:04

On 03 December 1999 14:34, Paul Moore wrote:

[Disclaimer: I've skimmed rational.hpp, rather than having read & inwardly
digested it!]

> 1. Rationals are stored as normalised (numerator, denominator) pairs. This
> has the advantage of simplicity. I don't see the normalisation cost as
> critical, but I'm willing to listen to arguments.

 There are certain situations where not doing the normalisation is
advantageous (for interests sake, the case I'm thinking of right now is that
in some of the American financial markets, prices are quoted as fractions.
Most options traders aren't aware that 8/16 is the same as 1/2 - but then,
these are people that use numbers like 100.23&16/32...which means 100.235.

 Of course, the simple fact that there _is_ a cost for normalisation could
be seen as an argument against it happening automatically. If one wants the
normalisation to take place, then one can do the normalisation explicitly.
(Assuming normalise() is made publicly accessible, of course)


Andy Sawyer, Technical Director, Sufficiently Advanced Technology Ltd.
mailto:andys_at_[hidden]        ICQ:14417938
Mobile: (+44)7970 299892 [Voice/SMS] (+44)7970 523053 [Fax]
"Any technology distinguishable from magic is insufficiently advanced"

Boost list run by bdawes at, gregod at, cpdaniel at, john at