Boost C++ Libraries: Ticket #6517: boost::math::isfinite returns false for unsigned int 0 https://svn.boost.org/trac10/ticket/6517 <p> from: boost/math/distributions/detail/common_error_handling.hpp </p> <p> (boost::math::isfinite)(0U) returns 0 </p> <p> (boost::math::isfinite)(1U) returns 1 </p> <p> To recreate the problem, the following program: </p> <hr /> <p> #include &lt;iostream&gt; #include &lt;boost/math/distributions/detail/common_error_handling.hpp&gt; int main(int argc, char* argv[]) { </p> <blockquote> <p> std::cout &lt;&lt; "isfinite(0U)=" &lt;&lt; (boost::math::isfinite)(0U) &lt;&lt; std::endl; std::cout &lt;&lt; "isfinite(1U)=" &lt;&lt; (boost::math::isfinite)(0U) &lt;&lt; std::endl; </p> </blockquote> <p> } </p> <hr /> <p> prints: </p> <hr /> <p> isfinite(0U)=0 isfinite(1U)=0 </p> <hr /> <p> This can't happen with the std::isinf() tests because they only take floating point args, so the unsigned int would get cast. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6517 Trac 1.4.3 John Maddock Tue, 10 Jul 2012 17:18:04 GMT status changed https://svn.boost.org/trac10/ticket/6517#comment:1 https://svn.boost.org/trac10/ticket/6517#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket John Maddock Thu, 12 Jul 2012 09:51:35 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6517#comment:2 https://svn.boost.org/trac10/ticket/6517#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/79438" title="Allow fpclassify and friends to be used with integer types via the ...">[79438]</a>) Allow fpclassify and friends to be used with integer types via the usual promotion mechanism. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6517" title="#6517: Bugs: boost::math::isfinite returns false for unsigned int 0 (closed: fixed)">#6517</a>. </p> Ticket John Maddock Thu, 02 Aug 2012 11:58:21 GMT milestone changed https://svn.boost.org/trac10/ticket/6517#comment:3 https://svn.boost.org/trac10/ticket/6517#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.52.0</span> </li> </ul> Ticket