Boost C++ Libraries: Ticket #1632: Default Interval rounding policies incomplete https://svn.boost.org/trac10/ticket/1632 <p> Report originates at <a class="ext-link" href="http://bugs.debian.org/440178"><span class="icon">​</span>http://bugs.debian.org/440178</a> </p> <p> The rounding policy requirements (<a class="ext-link" href="http://boost.org/libs/numeric/interval/doc/rounding.htm"><span class="icon">​</span>http://boost.org/libs/numeric/interval/doc/rounding.htm</a>) list e.g. tan_down(), but none of the implementations in rounded_arith.hpp implement it. </p> <p> The result is that this code fails to compile: </p> <pre class="wiki">#include &lt;boost/numeric/interval.hpp&gt; int main( int ac, char* av[] ) { boost::numeric::interval&lt;double&gt; I(0.1, 0.2); I = tan(I); return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1632 Trac 1.4.3 Douglas Gregor Mon, 11 Feb 2008 20:10:31 GMT owner changed https://svn.boost.org/trac10/ticket/1632#comment:1 https://svn.boost.org/trac10/ticket/1632#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">No-Maintainer</span> </li> </ul> Ticket Steven Robbins <smr@…> Wed, 21 May 2008 06:41:09 GMT <link>https://svn.boost.org/trac10/ticket/1632#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1632#comment:2</guid> <description> <p> This bug is still present in 1.35.0. </p> </description> <category>Ticket</category> </item> <item> <author>Ben Galehouse <bgalehouse@…></author> <pubDate>Sat, 24 May 2008 16:15:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1632#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1632#comment:3</guid> <description> <p> According to the documentation at <a href="http://www.boost.org/doc/libs/1_35_0/libs/numeric/interval/doc/rounding.htm">http://www.boost.org/doc/libs/1_35_0/libs/numeric/interval/doc/rounding.htm</a> 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. </p> <p> 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. (<a class="ext-link" href="http://math.berkeley.edu/~wilken/code/gmpfrxx/"><span class="icon">​</span>http://math.berkeley.edu/~wilken/code/gmpfrxx/</a>) With it I can declare the specialization </p> <pre class="wiki">template&lt;&gt; struct rounded_math&lt;mpfr_class&gt; : save_state_nothing&lt;rounded_transc_std&lt;mpfr_class&gt; &gt; {}; </pre><p> and then code like </p> <pre class="wiki"> j = boost::numeric::interval&lt;mpfr_class&gt; (0.1,0.2); j = boost::numeric::tan(j); std::cout &lt;&lt; "[" &lt;&lt; j.lower() &lt;&lt; "," &lt;&lt; j.upper() &lt;&lt; "]" &lt;&lt; "\n"; </pre><p> compiles, executes, and gives plausible looking results. Therefore, I think this is working as designed. </p> </description> <category>Ticket</category> </item> </channel> </rss>