Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2001-05-15 15:14:03


On Tuesday, May 15, 2001, at 03:33 PM, Gabriel Dos Reis wrote:
> Beman Dawes <bdawes_at_[hidden]> writes:
>
> | So a question is do you support that by having a whole bunch of
> different
> | functions, or by the class template taking some kind of a parameter
> | (perhaps a traits or policy class) performing the rounding desired?
>
> I'm leaning toward a trait-based solution.

I'm not positive that a trait-based solution is not the way to go, but
I'm not yet convinced it is yet either. One of the uses for rounding
mode manipulation is to run a computation with it set two ways to get a
feel for the roundoff error in the result. By making rounding mode a
compile time decision one is mandating that such users will have twice
the code size (than if it is a run time parameter).

In general I'm a very big fan of moving as much computation as possible
to compile time. But part of me is questioning a compile time rounding
mode. C describes rounding mode in the context of a floating point
environment (which can be manipulated at run time). That model may be
worthy of study.

-Howard


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