Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge for 1.84 #570

Merged
merged 14 commits into from
Nov 3, 2023
6 changes: 3 additions & 3 deletions .github/workflows/multiprecision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++-12, clang++-14 ]
standard: [ c++14, c++17, c++20, c++2b ]
standard: [ c++14, c++17 ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++-10, g++-11, clang++-10, clang++-11 ]
standard: [ c++14, c++17, c++2a ]
standard: [ c++14, c++17 ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -446,7 +446,7 @@ jobs:
fail-fast: false
matrix:
toolset: [ msvc-14.0 ]
standard: [ 14, 17 ]
standard: [ 14, latest ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion include/boost/multiprecision/cpp_bin_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bi
{
return number_type(0);
}
static constexpr number_type denorm_min() { return number_type(0); }
static constexpr number_type denorm_min() { return get_min(); }
static constexpr bool is_iec559 = false;
static constexpr bool is_bounded = true;
static constexpr bool is_modulo = false;
Expand Down
2 changes: 1 addition & 1 deletion include/boost/multiprecision/cpp_dec_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3591,7 +3591,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_de
static constexpr boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> infinity() { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::inf(); }
static constexpr boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> quiet_NaN() { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::nan(); }
static constexpr boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> signaling_NaN() { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::zero(); }
static constexpr boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> denorm_min() { return boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::zero(); }
static constexpr boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> denorm_min() { return (boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>::min)(); }
};

template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down
4 changes: 2 additions & 2 deletions include/boost/multiprecision/cpp_int/bitwise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,12 @@ inline BOOST_MP_CXX14_CONSTEXPR void left_shift_generic(Int& result, double_limb
++i;
}
}
for (; rs - i >= 2 + offset; ++i)
for (; rs - i >= static_cast<std::size_t>(static_cast<std::size_t>(2u) + offset); ++i)
{
pr[rs - 1 - i] = pr[rs - 1 - i - offset] << shift;
pr[rs - 1 - i] |= pr[rs - 2 - i - offset] >> (Int::limb_bits - shift);
}
if (rs - i >= 1 + offset)
if (rs - i >= static_cast<std::size_t>(static_cast<std::size_t>(1u) + offset))
{
pr[rs - 1 - i] = pr[rs - 1 - i - offset] << shift;
++i;
Expand Down
10 changes: 8 additions & 2 deletions include/boost/multiprecision/cpp_int/divide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,14 @@ eval_modulus(
const limb_type mod)
{
const std::ptrdiff_t n = static_cast<std::ptrdiff_t>(a.size());
const double_limb_type two_n_mod = static_cast<limb_type>(1u) + (~static_cast<limb_type>(0u) - mod) % mod;
limb_type res = a.limbs()[n - 1] % mod;

const double_limb_type two_n_mod =
static_cast<double_limb_type>
(
static_cast<double_limb_type>(1u) + static_cast<limb_type>(static_cast<limb_type>(~static_cast<limb_type>(0u) - mod) % mod)
);

limb_type res = a.limbs()[n - 1] % mod;

for (std::ptrdiff_t i = n - 2; i >= 0; --i)
res = static_cast<limb_type>(static_cast<double_limb_type>(static_cast<double_limb_type>(res * two_n_mod) + a.limbs()[i]) % mod);
Expand Down
4 changes: 2 additions & 2 deletions include/boost/multiprecision/gmp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3595,7 +3595,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_fl
static constexpr number_type infinity() { return number_type(); }
static constexpr number_type quiet_NaN() { return number_type(); }
static constexpr number_type signaling_NaN() { return number_type(); }
static constexpr number_type denorm_min() { return number_type(); }
static constexpr number_type denorm_min() { return (min)(); }
static constexpr bool is_iec559 = false;
static constexpr bool is_bounded = true;
static constexpr bool is_modulo = false;
Expand Down Expand Up @@ -3871,7 +3871,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_ra
static number_type infinity() { return number_type(); }
static number_type quiet_NaN() { return number_type(); }
static number_type signaling_NaN() { return number_type(); }
static number_type denorm_min() { return number_type(); }
static number_type denorm_min() { return (min)(); }
static constexpr bool is_iec559 = false;
static constexpr bool is_bounded = false;
static constexpr bool is_modulo = false;
Expand Down
2 changes: 1 addition & 1 deletion include/boost/multiprecision/mpfi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::mpfi_f
{
return number_type(0);
}
static constexpr number_type denorm_min() { return number_type(0); }
static constexpr number_type denorm_min() { return (min)(); }
static constexpr bool is_iec559 = false;
static constexpr bool is_bounded = true;
static constexpr bool is_modulo = false;
Expand Down
4 changes: 2 additions & 2 deletions include/boost/multiprecision/mpfr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3434,7 +3434,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::mpfr_f
{
return number_type(0);
}
static constexpr number_type denorm_min() { return number_type(0); }
static constexpr number_type denorm_min() { return (min)(); }
static constexpr bool is_iec559 = false;
static constexpr bool is_bounded = true;
static constexpr bool is_modulo = false;
Expand Down Expand Up @@ -3550,7 +3550,7 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::mpfr_f
return value;
}
static number_type signaling_NaN() { return number_type(0); }
static number_type denorm_min() { return number_type(0); }
static number_type denorm_min() { return (min)(); }
static constexpr bool is_iec559 = false;
static constexpr bool is_bounded = true;
static constexpr bool is_modulo = false;
Expand Down
2 changes: 1 addition & 1 deletion performance/sf_performance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <boost/math/distributions/non_central_t.hpp>
#include <libs/math/test/table_type.hpp>
#include <boost/chrono.hpp>
#include <boost/array.hpp>
#include <array>
#include <boost/thread.hpp>
#include <boost/atomic.hpp>

Expand Down
1 change: 1 addition & 0 deletions test/concepts/number_concept_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#pragma warning(disable : 4503) // decorated name length exceeded, name was truncated
#endif

#include <boost/concept/assert.hpp>
#include <boost/container_hash/hash.hpp>
#include <libs/math/test/compile_test/poison.hpp>

Expand Down
2 changes: 1 addition & 1 deletion test/math/high_prec/gamma.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

static const boost::array<boost::array<typename table_type<T>::type, 3>, 500> gamma = {{{SC_(8.45530509948730468750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01), SC_(1.11676792084632275714192215809847832812560655161416701540037514678588899552795223636051283861515685855053582939146274240113874531527973814210488207830128530900559599074170389066138081891070712920623473461857632254352617595899153121789055651865429663273105801624222067275035146160407682419814612559770937851333313258174693831239060158272144283644033402005812336141640353704703451805075743457651474500575180336149704581761302422616802534269713673320145810616702623379426577267381016596640646036780085640e+00), SC_(1.10438728442867816609665916944098399086765601795314917615577669041382221945245269046345957164829024229823010663264720601624809651655116368339246859099278886577422386896811750937967494940960029250224075543433744666205413027910764506859493838993507216401131983731121529344952082060498119577899781093069658373786189150246027769179901839580061229387653730476486565832292623869480613925012343335744507187985817127088673548820437219886661135524261767270766239756270078148544872782377812888609878714473093021e-01)},
static const std::array<std::array<typename table_type<T>::type, 3>, 500> gamma = {{{SC_(8.45530509948730468750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01), SC_(1.11676792084632275714192215809847832812560655161416701540037514678588899552795223636051283861515685855053582939146274240113874531527973814210488207830128530900559599074170389066138081891070712920623473461857632254352617595899153121789055651865429663273105801624222067275035146160407682419814612559770937851333313258174693831239060158272144283644033402005812336141640353704703451805075743457651474500575180336149704581761302422616802534269713673320145810616702623379426577267381016596640646036780085640e+00), SC_(1.10438728442867816609665916944098399086765601795314917615577669041382221945245269046345957164829024229823010663264720601624809651655116368339246859099278886577422386896811750937967494940960029250224075543433744666205413027910764506859493838993507216401131983731121529344952082060498119577899781093069658373786189150246027769179901839580061229387653730476486565832292623869480613925012343335744507187985817127088673548820437219886661135524261767270766239756270078148544872782377812888609878714473093021e-01)},
{SC_(1.39026832580566406250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), SC_(8.87837246534584512058304626597150000489120292563756272246130863589440629431328166236343343023478965830481648988944668013833863592688512739847732271129409060356695212103238739655240822053671736250775878014127604440817225103010320322756075484745769185701456653223475749864397685319786785385530182719007531303116138466452735235078861018575437520732342354574967183308070807923233032727588780923086501266291147367564653286869648484915713961300281876539970618140056759819325004245961660980554836491213594461e-01), SC_(-1.18966833717491030777529019926331960352855377707641323046275606078389124027926611789911603150540144713683748681801863772072067302459578683018790819197528173413969356904557087663396842789779718125888832504274452988602707088024742817513733531775897173110489239191365127876847654130551501903438865671258532679739640203442463217240189322306203147786367096739239036281487648421042118138143391813517167916949838797835701356844050619004326570975617904601257077440910867376277877219954044806432791089137635152e-01)},
{SC_(1.43504619598388671875000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), SC_(8.85908592055477020544823146996462988920753671462990877927427523793784391636857990149923096368122868020391764231333911220440936193158035215379333873738823239728773696032128851923243880532734156757960723683643045365212843713096041451134263420009087064362953191913886157628325070283143368675406959711653730415068180223485945836948634468821206791379329892575297995361852566312748126836116054701645545213593209611892028096694432232545135202461301088136703343459844999000604508302338782169984763967607501314e-01), SC_(-1.21141502936978554470331924245181844536653300286225422140798757837139525637498346623087068230762388958190805297179369893104223420947821790937027145400844138709085611406641604698885150056395888192847451388558341660380510005326476801210828545697252686002267491495285666799318711798085628503140489815338199728719860874280450505965277773655528536902886328052951994398070322644031431224912585052114632613788261969630244977993915035447500319483308338977079266591371885961850522890584558525442875774358053017e-01)},
{SC_(2.42817401885986328125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+00), SC_(1.26548780776578840420381427518520449855608041962978420562324571651972061904909219213050500986673056140976438565871543352029900201913847740572555310587852358164122797887781229263011351199466922757394212036282675265716319706112696638181549111225164845253224133071688478880244916384306812998466169110572223013741424946407661202839829092882797566392445456945362691783965322378415320774013882498835505927125822970066960016136071528037620210173970460365408629248314390843812310532824823798560386378408531758e+00), SC_(2.35457666634852101044747755129837867262195483343254983494923132129084740599968117459876158642974817916730545060077157131801833625262395918879296296970891493947670708984616066541861044565554092681572085484952572699514279293900419924199381144525738569464382042666825565090748449951697963176145208698932021640416912747873111038321169415221202446804427993828714087337477405157815350337354930690780319199568346826770338612483088645913829939414504125261936354188139129621440596127411902107048621213505069787e-01)},
Expand Down
Loading