Skip to content

Commit

Permalink
Merge pull request #561 from boostorg/develop
Browse files Browse the repository at this point in the history
Merge develop for Boost 1.83
  • Loading branch information
mborland authored Jun 28, 2023
2 parents 4041397 + 5f81a78 commit 380aae3
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/multiprecision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES include=/usr/include/eigen3
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=BOOST_MP_SF_CONCEPT_TESTS include=/usr/include/eigen3
working-directory: ../boost-root/libs/multiprecision/test
- name: b2 config
run: cat bin.v2/config.log
Expand Down Expand Up @@ -516,7 +516,7 @@ jobs:
run: ..\..\..\b2 print_config_info print_math_info %ARGS%
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }}
run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} define=BOOST_MP_SF_CONCEPT_TESTS
working-directory: ../boost-root/libs/multiprecision/test
- name: b2 config
run: cat bin.v2/config.log
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Boost Multiprecision Library
============================

>ANNOUNCEMENT: Support for C++11 will be deprecated in this library starting in July 2023 (Boost 1.82).
>New features will require *at least* C++14, as will existing features starting with the deprecation release.
>ANNOUNCEMENT: This library now requires a compliant C++14 compiler.
| | Master | Develop |
|------------------|----------|-------------|
Expand Down
12 changes: 10 additions & 2 deletions include/boost/multiprecision/cpp_int/misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1,

template <class R, std::size_t MinBits1, std::size_t MaxBits1, cpp_integer_type SignType1, cpp_int_check_type Checked1, class Allocator1>
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<std::is_floating_point<R>::value && !is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, void>::type
eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& backend) noexcept(boost::multiprecision::detail::is_arithmetic<R>::value)
eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& backend) noexcept(boost::multiprecision::detail::is_arithmetic<R>::value && std::numeric_limits<R>::has_infinity)
{
BOOST_MP_FLOAT128_USING using std::ldexp;
if (eval_is_zero(backend))
Expand Down Expand Up @@ -244,7 +244,15 @@ eval_convert_to(R* result, const cpp_int_backend<MinBits1, MaxBits1, SignType1,
if ((eval_lsb_imp(backend) < static_cast<std::size_t>(bits)) || eval_bit_test(backend, static_cast<std::size_t>(bits + 1)))
{
#ifdef BOOST_MP_MATH_AVAILABLE
*result = boost::math::float_next(*result);
BOOST_IF_CONSTEXPR(std::numeric_limits<R>::has_infinity)
{
// Must NOT throw:
*result = boost::math::float_next(*result, boost::math::policies::make_policy(boost::math::policies::overflow_error<boost::math::policies::ignore_error>()));
}
else
{
*result = boost::math::float_next(*result);
}
#else
using std::nextafter; BOOST_MP_FLOAT128_USING
*result = nextafter(*result, *result * 2);
Expand Down
1 change: 1 addition & 0 deletions include/boost/multiprecision/number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ class number
static BOOST_MP_CXX14_CONSTEXPR void default_variable_precision_options(variable_precision_options opts)
{
Backend::default_variable_precision_options(opts);
Backend::thread_default_variable_precision_options(opts);
}
static BOOST_MP_CXX14_CONSTEXPR void thread_default_variable_precision_options(variable_precision_options opts)
{
Expand Down
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -163,3 +165,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_bessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -130,3 +132,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_beta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -117,3 +119,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
12 changes: 12 additions & 0 deletions test/concepts/sf_concept_check_beta_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//

#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -113,3 +116,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_beta_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -115,3 +117,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_elliptic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -134,3 +136,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_gamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -138,3 +140,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
11 changes: 11 additions & 0 deletions test/concepts/sf_concept_check_poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// This tests that cpp_dec_float_50 meets our
// conceptual requirements when used with Boost.Math.
//
#ifdef BOOST_MP_SF_CONCEPT_TESTS

#ifdef _MSC_VER
#define _SCL_SECURE_NO_WARNINGS
#pragma warning(disable : 4800)
Expand Down Expand Up @@ -125,3 +127,12 @@ int main()
{
foo();
}

#else

int main()
{
return 0;
}

#endif
5 changes: 4 additions & 1 deletion test/test_preserve_target_precision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ template <class T>
void test()
{
T::thread_default_precision(100);
T::thread_default_variable_precision_options(boost::multiprecision::variable_precision_options::preserve_target_precision);
T::default_variable_precision_options(boost::multiprecision::variable_precision_options::preserve_target_precision);

BOOST_CHECK_EQUAL((int)T::default_variable_precision_options(), (int)boost::multiprecision::variable_precision_options::preserve_target_precision);
BOOST_CHECK_EQUAL((int)T::thread_default_variable_precision_options(), (int)boost::multiprecision::variable_precision_options::preserve_target_precision);

T hp1("0.1"), hp2("0.3"), hp3("0.11"), hp4("0.1231");

Expand Down

0 comments on commit 380aae3

Please sign in to comment.