|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72994 - sandbox/coerce/libs/coerce/test
From: vexocide_at_[hidden]
Date: 2011-07-09 18:39:09
Author: vexocide
Date: 2011-07-09 18:39:08 EDT (Sat, 09 Jul 2011)
New Revision: 72994
URL: http://svn.boost.org/trac/boost/changeset/72994
Log:
Fixed several issues with the floating point tests
Text files modified:
sandbox/coerce/libs/coerce/test/floating_point.cpp | 25 +++++--------------------
1 files changed, 5 insertions(+), 20 deletions(-)
Modified: sandbox/coerce/libs/coerce/test/floating_point.cpp
==============================================================================
--- sandbox/coerce/libs/coerce/test/floating_point.cpp (original)
+++ sandbox/coerce/libs/coerce/test/floating_point.cpp 2011-07-09 18:39:08 EDT (Sat, 09 Jul 2011)
@@ -77,39 +77,24 @@
BOOST_CHECK_CLOSE_FRACTION(
coerce::as<T>("1.01828183"),
static_cast<T>(1.01828183L),
- std::numeric_limits<double>::epsilon());
+ std::numeric_limits<T>::epsilon());
BOOST_CHECK_CLOSE_FRACTION(
coerce::as<T>("1.0e23"),
static_cast<T>(1.0e23L),
- std::numeric_limits<double>::epsilon());
+ std::numeric_limits<T>::epsilon());
BOOST_CHECK_CLOSE_FRACTION(
coerce::as<T>("1.0E23"),
static_cast<T>(1.0e23L),
- std::numeric_limits<double>::epsilon());
+ std::numeric_limits<T>::epsilon());
BOOST_CHECK_CLOSE_FRACTION(
coerce::as<T>("1.0e+23"),
static_cast<T>(1.0e23L),
- std::numeric_limits<double>::epsilon());
+ std::numeric_limits<T>::epsilon());
BOOST_CHECK_CLOSE_FRACTION(
coerce::as<T>("1.0e-23"),
static_cast<T>(1.0e-23L),
- std::numeric_limits<double>::epsilon());
-
- if (std::numeric_limits<T>::max() > 1.0e2603L) {
- BOOST_CHECK_CLOSE_FRACTION(
- coerce::as<T>("1.0e2603"),
- static_cast<T>(1.0e2603L),
- std::numeric_limits<double>::epsilon());
- BOOST_CHECK_CLOSE_FRACTION(
- coerce::as<T>("1.0e+2603"),
- static_cast<T>(1.0e2603L),
- std::numeric_limits<double>::epsilon());
- BOOST_CHECK_CLOSE_FRACTION(
- coerce::as<T>("1.0e-2603"),
- static_cast<T>(1.0e-2603L),
- std::numeric_limits<double>::epsilon());
- }
+ std::numeric_limits<T>::epsilon());
BOOST_CHECK_EQUAL(math::fpclassify(coerce::as<T>("NaN")), FP_NAN);
BOOST_CHECK_EQUAL(math::fpclassify(coerce::as<T>("-NaN")), FP_NAN);
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