Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52248 - trunk/libs/math/test
From: john_at_[hidden]
Date: 2009-04-08 07:31:18


Author: johnmaddock
Date: 2009-04-08 07:31:17 EDT (Wed, 08 Apr 2009)
New Revision: 52248
URL: http://svn.boost.org/trac/boost/changeset/52248

Log:
signbit can return either zero or not, rather than true/false.
Text files modified:
   trunk/libs/math/test/test_sign.cpp | 18 +++++++++---------
   1 files changed, 9 insertions(+), 9 deletions(-)

Modified: trunk/libs/math/test/test_sign.cpp
==============================================================================
--- trunk/libs/math/test/test_sign.cpp (original)
+++ trunk/libs/math/test/test_sign.cpp 2009-04-08 07:31:17 EDT (Wed, 08 Apr 2009)
@@ -25,39 +25,39 @@
    RealType a = 0;
    RealType b = 1;
    RealType c = -1;
- BOOST_CHECK_EQUAL(boost::math::signbit(a), false);
+ BOOST_CHECK_EQUAL(boost::math::signbit(a), 0);
    BOOST_CHECK_EQUAL(boost::math::sign(a), 0);
    BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(1));
    BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(1));
    a = 1;
- BOOST_CHECK_EQUAL(boost::math::signbit(a), false);
+ BOOST_CHECK_EQUAL(boost::math::signbit(a), 0);
    BOOST_CHECK_EQUAL(boost::math::sign(a), 1);
    BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(1));
    BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(1));
    a = -1;
- BOOST_CHECK_EQUAL(boost::math::signbit(a), true);
+ BOOST_CHECK(boost::math::signbit(a) != 0);
    BOOST_CHECK_EQUAL(boost::math::sign(a), -1);
    BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(-1));
    BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(-1));
    a = boost::math::tools::max_value<RealType>();
- BOOST_CHECK_EQUAL(boost::math::signbit(a), false);
+ BOOST_CHECK_EQUAL(boost::math::signbit(a), 0);
    BOOST_CHECK_EQUAL(boost::math::sign(a), 1);
    BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(1));
    BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(1));
    a = -boost::math::tools::max_value<RealType>();
- BOOST_CHECK_EQUAL(boost::math::signbit(a), true);
+ BOOST_CHECK(boost::math::signbit(a) != 0);
    BOOST_CHECK_EQUAL(boost::math::sign(a), -1);
    BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(-1));
    BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(-1));
    if(std::numeric_limits<RealType>::has_infinity)
    {
       a = std::numeric_limits<RealType>::infinity();
- BOOST_CHECK_EQUAL(boost::math::signbit(a), false);
+ BOOST_CHECK_EQUAL(boost::math::signbit(a), 0);
       BOOST_CHECK_EQUAL(boost::math::sign(a), 1);
       BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(1));
       BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(1));
       a = -std::numeric_limits<RealType>::infinity();
- BOOST_CHECK_EQUAL(boost::math::signbit(a), true);
+ BOOST_CHECK(boost::math::signbit(a) != 0);
       BOOST_CHECK_EQUAL(boost::math::sign(a), -1);
       BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(-1));
       BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(-1));
@@ -65,12 +65,12 @@
    if(std::numeric_limits<RealType>::has_quiet_NaN)
    {
       a = std::numeric_limits<RealType>::quiet_NaN();
- BOOST_CHECK_EQUAL(boost::math::signbit(a), false);
+ BOOST_CHECK_EQUAL(boost::math::signbit(a), 0);
       BOOST_CHECK_EQUAL(boost::math::sign(a), 1);
       BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(1));
       BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(1));
       a = -std::numeric_limits<RealType>::quiet_NaN();
- BOOST_CHECK_EQUAL(boost::math::signbit(a), true);
+ BOOST_CHECK(boost::math::signbit(a) != 0);
       BOOST_CHECK_EQUAL(boost::math::sign(a), -1);
       BOOST_CHECK_EQUAL(boost::math::copysign(b, a), RealType(-1));
       BOOST_CHECK_EQUAL(boost::math::copysign(c, a), RealType(-1));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk