Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-03-26 15:07:25

Guillaume Melquiond wrote:
> If the rational type supports rounding (up and down), it will become a
> target for interval arithmetic, a possible alternative to floating
> point types.

> With rounded rational numbers, you would get a bit of both worlds: the
> computations would still be constant-time, and yet you would keep the
> exactness of the results for the smaller rationals. And since it is
> interval arithmetic we are talking about, the loss of precision for
> the bigger rationals is no problem at all (as long as there is up and down
> rounding).

Peter Dimov wrote:
> My vote is that the default (and only) behavior should be to do the
> right thing, which in this case means adopting Andras's proposal in
> its original form. FWIW.

Thanks, guys. It's good to know there is support for rounding.

Peter, could you elaborate on why rounding is the only legitimate behaviour when
using rational with a limited precision type?


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