bigfloat II

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Apr 9 12:43:15 PDT 2009


Paul D. Anderson wrote:
> Andrei Alexandrescu Wrote:
> 
>> Paul D. Anderson wrote: [...]
>>> Does anyone have strong feelings for/against any of these
>>> options??
>>> 
>>> Paul
>> What does the context exactly consist of?
> 
> The rounding mode, the precision (which indicates when (whether)
> rounding is needed), and flags for determining which error conditions
> are ignored, reported or trapped.
> 
> 
> 

I see. Then another possibility may be to make them part of the type by 
making them policies. The tradeoffs are obvious.

enum RoundingMode { ... }
enum Precision { ... }
enum Flags { ... }
struct BigFloatT(
     RoundingMode rm = ...,
     Precision pr = ...,
     uint flags = ...)
{
    ...
}

alias BigFloatT!(... common options ...) BigFloat;


Andrei



More information about the Digitalmars-d mailing list