|
Boost : |
From: Cromwell Enage (sponage_at_[hidden])
Date: 2005-11-10 11:10:28
--- Peder Holt wrote:
> I have a series available that converges for X>1.
> I'll implement it once the pi<> template is ready.
I just learned that when a compiler sees a plain
struct or a full specialization inherit from an MPL
expression, it eagerly evaluates the expression,
whehter or not the program actually asks for the
struct/specialization. This is fine for
pi<double_tag>, but bad news for pi<rational_tag> and
pi<mixed_number_tag>, because I don't yet have a
generic way of representing 1/5 and 1/239 -- Hmmm.
Maybe I should implement an inverse metafunction.
Yeah, that'll solve this particular problem.
> Btw. How about making the syntax a bit clearer by
> dropping the BOOST_PP_MUL etc. syntax? Why not just:
>
> typedef typename minus< \
> int_<1> \
> , times< \
> divides< \
> angle_squared \
> , int_< \
> (\
>
> (BOOST_MPL_LIMIT_MATH_SINE_SERIES-x)*2+1\
> )*\
> (\
>
> (BOOST_MPL_LIMIT_MATH_SINE_SERIES-x)*2\
> )\
> >\
> > \
> , BOOST_PP_CAT(prefix, x) \
> > \
> >::type \
>
> I think this is more readable, and less limited
> (BOOST_PP_MUL(129,2) exceeds 256, not that it
> matters much, as we should never have this long
> series :)
Will do.
> Have uploaded a version of tangent that uses the
> preprocessor, plus a version of arcus_sine and an
> alternative arcus_tangent that does not :) to the
> vault.
Okay, I'll check them out.
Cromwell D. Enage
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk