|
Boost : |
From: Peder Holt (peder.holt_at_[hidden])
Date: 2005-06-08 14:55:14
On 6/8/05, Cromwell Enage <sponage_at_[hidden]> wrote:
> --- Sérgio Vale e Pace wrote:
> > I can't say for everyone else, but I am very
> > interested, but AFAIK there is a current development
> > in this area on mpl, but I can be wrong,
>
> No, you are correct, I just haven't gotten around to
> decimals yet.
>
> > but yor code looks promising. how well does it
> > integrate with other mpl stuff?
>
> I would like to know as well. I second the request to
> have it uploaded to
> <http://boost-sandbox.sourceforge.net/vault/>
>
> > On 6/8/05, Peder Holt wrote:
> > > Is there any interest in a compile-time
> > > meta-version of double?
>
> Most definitely.
>
> > > Syntax:
> > >
> > > //Definition
> > > typedef META_DOUBLE(3.1415926535897932384626433)
> > > pi;
> > > //Or
> > > META_DOUBLE(3.1415926535897932384626433) pi_;
>
> Yes, very compact.
>
> > > //Mathematical operations
> > > typedef math::meta::add<pi,pi>::type pi2;
>
> You can specialize the MPL plus metafunction so that
> it works on your double metatype. Or I can do that
> for you :)
I have mpl-enabled double_ for plus and less, and uploaded this to the vault.
I think I can handle the rest of the fundamental operators, but what I
really need help on is:
Is it possible to make compile-time versions of the basic mathematical
functions? sin,cos,sqrt etc. If you have an idea of how to approach
this (given the existence of the basic mpl meta-operators) I would
really be interested.
Regards,
Peder
>
> > > //Evaluation:
> > >
> > > assert(META_DOUBLE_EVAL(pi2)==
> > > 3.1415926535897932384626433*2);
> > >
> > > This implementation uses two ints to represent the
> > > decimals, and a short to represent the exponent.
>
> Like I said, please upload to the sandbox vault so
> that we can examine the implementation.
>
> Cromwell D. Enage
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Make Yahoo! your home page
> http://www.yahoo.com/r/hs
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk