Boost logo

Boost Users :

Subject: [Boost-users] [interval] Power
From: Sensei (senseiwa_at_[hidden])
Date: 2015-07-22 09:30:36


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).

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 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