Opened 11 years ago

Last modified 10 years ago

#1632 new Bugs

Default Interval rounding policies incomplete

Reported by: Steven Robbins <smr@…> Owned by: No-Maintainer
Milestone: Boost 1.36.0 Component: numeric
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc: 440178@…


Report originates at

The rounding policy requirements ( list e.g. tan_down(), but none of the implementations in rounded_arith.hpp implement it.

The result is that this code fails to compile:

#include <boost/numeric/interval.hpp>

int main( int ac, char* av[] )
    boost::numeric::interval<double> I(0.1, 0.2);
    I = tan(I);

    return 0;

Change History (3)

comment:1 Changed 11 years ago by Douglas Gregor

Owner: changed from Douglas Gregor to No-Maintainer

comment:2 Changed 10 years ago by Steven Robbins <smr@…>

This bug is still present in 1.35.0.

comment:3 in reply to:  description Changed 10 years ago by Ben Galehouse <bgalehouse@…>

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. ( With it I can declare the specialization

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.

Note: See TracTickets for help on using tickets.