mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-21 15:22:15 +00:00
correct rounding
fix memory leak for constructor failure in load_construct_data fix another bug in loading pointers [SVN r86487]
This commit is contained in:
@@ -148,13 +148,13 @@ bool A::operator==(const A &rhs) const
|
||||
return false;
|
||||
if(v != rhs.v)
|
||||
return false;
|
||||
if(w == 0 && std::fabs(rhs.w) > std::numeric_limits<float>::epsilon())
|
||||
if(w == 0 && std::fabs(rhs.w) > 2 * std::numeric_limits<float>::round_error())
|
||||
return false;
|
||||
if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon())
|
||||
if(std::fabs(rhs.w/w - 1.0) > 2 * std::numeric_limits<float>::round_error())
|
||||
return false;
|
||||
if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon())
|
||||
if(x == 0 && std::fabs(rhs.x - x) > 2 * std::numeric_limits<double>::round_error())
|
||||
return false;
|
||||
if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon())
|
||||
if(std::fabs(rhs.x/x - 1.0) > 2 * std::numeric_limits<double>::round_error())
|
||||
return false;
|
||||
if(0 != y.compare(rhs.y))
|
||||
return false;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// which use wchar_t as 2 byte objects will emit warnings. These should be
|
||||
// ignored.
|
||||
|
||||
#include <algorithm>
|
||||
#include <algorithm> // std::copy
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
|
||||
@@ -68,8 +68,8 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
ia >> boost::serialization::make_nvp("adoublecomplex", b1);
|
||||
}
|
||||
|
||||
BOOST_CHECK(std::abs(a-a1) <= 2.*std::numeric_limits<float>::round_error());
|
||||
BOOST_CHECK(std::abs(b-b1) <= 2.*std::numeric_limits<double>::round_error());
|
||||
BOOST_CHECK(std::abs(a-a1) <= (2 * std::numeric_limits<float>::round_error()));
|
||||
BOOST_CHECK(std::abs(b-b1) <= (2 * std::numeric_limits<double>::round_error()));
|
||||
|
||||
std::remove(testfile);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <algorithm>
|
||||
#include <algorithm> // std::copy
|
||||
#include <vector>
|
||||
#include <cstdlib> // for rand
|
||||
#include <functional>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
// should pass compilation and execution
|
||||
|
||||
#include <algorithm>
|
||||
#include <algorithm> // std::copy
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <cstddef> // size_t, NULL
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <cstdio> // remove
|
||||
#include <fstream>
|
||||
|
||||
#include <algorithm>
|
||||
#include <algorithm> // std::copy
|
||||
#include <vector>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -52,16 +52,16 @@ bool A::check_equal(const A &rhs) const
|
||||
BOOST_CHECK_EQUAL(l, rhs.l);
|
||||
BOOST_CHECK(!(
|
||||
w == 0
|
||||
&& std::fabs(rhs.w) > std::numeric_limits<float>::epsilon()
|
||||
&& std::fabs(rhs.w) > std::numeric_limits<float>::round_error()
|
||||
));
|
||||
BOOST_CHECK(!(
|
||||
std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon()
|
||||
std::fabs(rhs.w/w - 1.0) > 2.0 * std::numeric_limits<float>::round_error()
|
||||
));
|
||||
BOOST_CHECK(!(
|
||||
x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon()
|
||||
x == 0 && std::fabs(rhs.x - x) > 2.0 * std::numeric_limits<double>::round_error()
|
||||
));
|
||||
BOOST_CHECK(!(
|
||||
std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon()
|
||||
std::fabs(rhs.x/x - 1.0) > 2.0 * std::numeric_limits<double>::round_error()
|
||||
));
|
||||
BOOST_CHECK(!(0 != y.compare(rhs.y)));
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <algorithm>
|
||||
#include <algorithm> // std::copy
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
|
||||
Reference in New Issue
Block a user