Boost logo

Boost :

From: Sylvain Pion (pion_at_[hidden])
Date: 2002-09-07 11:45:10


On Sat, Sep 07, 2002 at 03:58:02AM +0200, Gabriel Dos Reis wrote:
> | Actually, the dream solution would be to modify the "floating-literals" grammar
> | in the standard, so that we can specify one of the four usual rounding modes,
> | for each constant that we give.
>
> I'm not sure you really need that complexity, for
> numeric_limits<>::radix power of 2 (covered by IEEE-854, and includes
> IBM formats) C99 hexadecimal-floatint-constant are sufficient. That
> really covers many cases.

It would make it easier to provide the various constants, I agree.
You still have to provide all cases depending on numeric_limits<>::digits,
though.

With my proposal, you could just write only one decimal constant with enough
precision, and the explicit rounding would do the right thing with whatever
values for digits and radix (provided the precision is enough for all planned
values of them).

-- 
Sylvain

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