|
Boost Users : |
Subject: Re: [Boost-users] [interval] Power
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2015-07-22 09:34:26
On Wed, Jul 22, 2015 at 9:30 AM, Sensei <senseiwa_at_[hidden]> wrote:
> Dear all,
>
> I am defining a "scalar" type for a project, and this scalar I'd like to be
> an interval. Among the operations, already provided by boost interval, I
> need pow(interval, interval).
That sounds more like a Range ?
http://www.boost.org/doc/libs/1_58_0/libs/range/doc/html/index.html
> Since there is no pow() function, but log() and exp() are defined, I
> mistakenly defined power as the obvious:
>
>
> typedef boost::numeric::interval<double> scalar;
>
> scalar p(1.0, 1.0), q(4, 100);
>
> log << "^ " << boost::numeric::exp(p * boost::numeric::log(q)) <<
> std::endl;
>
>
>
> Unfortunately, it won't work, and it gives me this error:
>
>
>
> /usr/local/include/boost/numeric/interval/transc.hpp:47:42: No member named
> 'log_down' in 'boost::numeric::interval_lib::rounded_math<double>'
>
> /usr/local/include/boost/numeric/interval/transc.hpp:34:16: No member named
> 'exp_down' in 'boost::numeric::interval_lib::rounded_math<double>'
>
>
>
> Is there any "correct" pow() function I can implement? Is something wrong
> with the definition of scalar?
>
>
> Thank you!
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net