[pkg-boost-devel] Bug#440178: [Boost C++ Libraries] #1632: Default Interval rounding policies incomplete

Boost C++ Libraries noreply at lists.boost.org
Sat May 24 16:15:02 UTC 2008

#1632: Default Interval rounding policies incomplete
  Reporter:  Steven Robbins <smr at debian.org>  |       Owner:  no-maintainer
      Type:  Bugs                             |      Status:  new          
 Milestone:  Boost 1.36.0                     |   Component:  numeric      
   Version:  Boost 1.34.1                     |    Severity:  Problem      
Resolution:                                   |    Keywords:               
Comment (by Ben Galehouse <bgalehouse at spamcop.net>):

 According to the documentation at
 in the "transcendental function" section, the standard library routines
 for tan, etc, do not typically satisfy the needed rounding properties and
 therefore the templates which implement them are disabled by default.

 I have used tan with the interval library. If you pass it a policy based
 on rounded_transc_std, it works fine.
 e.g. I have written a rounded_control specialization for the mpfr_class
 type from the gmpfrxx interface to mpfr.
 (http://math.berkeley.edu/~wilken/code/gmpfrxx/) With it I can declare the
 struct rounded_math<mpfr_class>
   : save_state_nothing<rounded_transc_std<mpfr_class> >
 and then code like
  j =  boost::numeric::interval<mpfr_class> (0.1,0.2);
   j = boost::numeric::tan(j);

   std::cout << "[" << j.lower() << "," << j.upper() << "]" << "\n";

 compiles, executes, and gives plausible looking results. Therefore, I
 think this is working as designed.

Ticket URL: <http://svn.boost.org/trac/boost/ticket/1632#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

More information about the pkg-boost-devel mailing list