[Boost-bugs] [Boost C++ Libraries] #6517: boost::math::isfinite returns false for unsigned int 0

Subject: [Boost-bugs] [Boost C++ Libraries] #6517: boost::math::isfinite returns false for unsigned int 0
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-02 21:23:46


#6517: boost::math::isfinite returns false for unsigned int 0
----------------------------------------------+-----------------------------
 Reporter: Bob Carpenter <carp@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: math
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: math isfinite |
----------------------------------------------+-----------------------------
 from: boost/math/distributions/detail/common_error_handling.hpp

 (boost::math::isfinite)(0U) returns 0

 (boost::math::isfinite)(1U) returns 1

 To recreate the problem, the following program:

 ----------------
 #include <iostream>
 #include <boost/math/distributions/detail/common_error_handling.hpp>
 int main(int argc, char* argv[]) {
   std::cout << "isfinite(0U)=" << (boost::math::isfinite)(0U) <<
 std::endl;
   std::cout << "isfinite(1U)=" << (boost::math::isfinite)(0U) <<
 std::endl;
 }
 -----------------
 prints:

 --------------------
 isfinite(0U)=0
 isfinite(1U)=0
 ---------------------

 This can't happen with the std::isinf() tests because they only take
 floating point args, so the unsigned int would get cast.

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

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC