diff --git a/include/boost/math/distributions/beta.hpp b/include/boost/math/distributions/beta.hpp index b313500be..1de399ead 100644 --- a/include/boost/math/distributions/beta.hpp +++ b/include/boost/math/distributions/beta.hpp @@ -498,7 +498,7 @@ namespace boost { return 1; } - return ibeta_inv(a, b, p, static_cast(0), Policy()); + return ibeta_inv(a, b, p, static_cast(nullptr), Policy()); } // quantile template @@ -535,7 +535,7 @@ namespace boost return 1; } - return ibetac_inv(a, b, q, static_cast(0), Policy()); + return ibetac_inv(a, b, q, static_cast(nullptr), Policy()); } // Quantile Complement } // namespace math diff --git a/include/boost/math/distributions/binomial.hpp b/include/boost/math/distributions/binomial.hpp index b54292aeb..02991e1b4 100644 --- a/include/boost/math/distributions/binomial.hpp +++ b/include/boost/math/distributions/binomial.hpp @@ -335,8 +335,8 @@ namespace boost // NOTE!!! The Clopper Pearson formula uses "successes" not // "successes+1" as usual to get the lower bound, // see http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm - return (t == clopper_pearson_exact_interval) ? ibeta_inv(successes, trials - successes + 1, probability, static_cast(0), Policy()) - : ibeta_inv(successes + 0.5f, trials - successes + 0.5f, probability, static_cast(0), Policy()); + return (t == clopper_pearson_exact_interval) ? ibeta_inv(successes, trials - successes + 1, probability, static_cast(nullptr), Policy()) + : ibeta_inv(successes + 0.5f, trials - successes + 0.5f, probability, static_cast(nullptr), Policy()); } static RealType find_upper_bound_on_p( RealType trials, @@ -357,8 +357,8 @@ namespace boost if(trials == successes) return 1; - return (t == clopper_pearson_exact_interval) ? ibetac_inv(successes + 1, trials - successes, probability, static_cast(0), Policy()) - : ibetac_inv(successes + 0.5f, trials - successes + 0.5f, probability, static_cast(0), Policy()); + return (t == clopper_pearson_exact_interval) ? ibetac_inv(successes + 1, trials - successes, probability, static_cast(nullptr), Policy()) + : ibetac_inv(successes + 0.5f, trials - successes + 0.5f, probability, static_cast(nullptr), Policy()); } // Estimate number of trials parameter: // diff --git a/include/boost/math/distributions/detail/derived_accessors.hpp b/include/boost/math/distributions/detail/derived_accessors.hpp index e2eca511b..d278e7877 100644 --- a/include/boost/math/distributions/detail/derived_accessors.hpp +++ b/include/boost/math/distributions/detail/derived_accessors.hpp @@ -65,7 +65,7 @@ inline typename Distribution::value_type hazard(const Distribution& dist, const value_type d = pdf(dist, x); if(d > p * tools::max_value()) return policies::raise_overflow_error( - "boost::math::hazard(const Distribution&, %1%)", 0, policy_type()); + "boost::math::hazard(const Distribution&, %1%)", nullptr, policy_type()); if(d == 0) { // This protects against 0/0, but is it the right thing to do? @@ -94,7 +94,7 @@ inline typename Distribution::value_type coefficient_of_variation(const Distribu value_type d = standard_deviation(dist); if((abs(m) < 1) && (d > abs(m) * tools::max_value())) { // Checks too that m is not zero, - return policies::raise_overflow_error("boost::math::coefficient_of_variation(const Distribution&, %1%)", 0, policy_type()); + return policies::raise_overflow_error("boost::math::coefficient_of_variation(const Distribution&, %1%)", nullptr, policy_type()); } return d / m; // so MSVC warning on zerodivide is spurious, and suppressed. } diff --git a/include/boost/math/distributions/geometric.hpp b/include/boost/math/distributions/geometric.hpp index 9a9f0ea07..b091bf1c6 100644 --- a/include/boost/math/distributions/geometric.hpp +++ b/include/boost/math/distributions/geometric.hpp @@ -158,7 +158,7 @@ namespace boost // Discrete Distributions" Yong CAI and K. KRISHNAMOORTHY // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf // - return ibeta_inv(successes, failures + 1, alpha, static_cast(0), Policy()); + return ibeta_inv(successes, failures + 1, alpha, static_cast(nullptr), Policy()); } // find_lower_bound_on_p static RealType find_upper_bound_on_p( @@ -187,7 +187,7 @@ namespace boost // Discrete Distributions" Yong CAI and K. Krishnamoorthy // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf // - return ibetac_inv(successes, failures, alpha, static_cast(0), Policy()); + return ibetac_inv(successes, failures, alpha, static_cast(nullptr), Policy()); } // find_upper_bound_on_p // Estimate number of trials : @@ -222,7 +222,7 @@ namespace boost if(false == geometric_detail::check_dist_and_k( function, p, k, &result, Policy()) && detail::check_probability(function, alpha, &result, Policy())) - { + { return result; } result = ibetac_inva(k + 1, p, alpha, Policy()); // returns n - k @@ -270,7 +270,7 @@ namespace boost BOOST_MATH_STD_USING // ADL of std functions. return 0; } // mode - + template inline RealType variance(const geometric_distribution& dist) { // Variance of Binomial distribution = (1-p) / p^2. @@ -446,7 +446,7 @@ namespace boost { return 0; } - + // log(1-x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small result = boost::math::log1p(-x, Policy()) / boost::math::log1p(-success_fraction, Policy()) - 1; // Subtract a few epsilons here too? diff --git a/include/boost/math/distributions/negative_binomial.hpp b/include/boost/math/distributions/negative_binomial.hpp index 34412bf4b..18eec0993 100644 --- a/include/boost/math/distributions/negative_binomial.hpp +++ b/include/boost/math/distributions/negative_binomial.hpp @@ -176,7 +176,7 @@ namespace boost // Discrete Distributions" Yong CAI and K. KRISHNAMOORTHY // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf // - return ibeta_inv(successes, failures + 1, alpha, static_cast(0), Policy()); + return ibeta_inv(successes, failures + 1, alpha, static_cast(nullptr), Policy()); } // find_lower_bound_on_p static RealType find_upper_bound_on_p( @@ -204,7 +204,7 @@ namespace boost // Discrete Distributions" Yong CAI and K. KRISHNAMOORTHY // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf // - return ibetac_inv(successes, failures, alpha, static_cast(0), Policy()); + return ibetac_inv(successes, failures, alpha, static_cast(nullptr), Policy()); } // find_upper_bound_on_p // Estimate number of trials : diff --git a/include/boost/math/policies/error_handling.hpp b/include/boost/math/policies/error_handling.hpp index b497c8f52..c4120d448 100644 --- a/include/boost/math/policies/error_handling.hpp +++ b/include/boost/math/policies/error_handling.hpp @@ -756,7 +756,7 @@ inline bool check_overflow(T val, R* result, const char* function, const Policy& BOOST_MATH_STD_USING if(fabs(val) > tools::max_value()) { - boost::math::policies::detail::raise_overflow_error(function, 0, pol); + boost::math::policies::detail::raise_overflow_error(function, nullptr, pol); *result = static_cast(val); return true; } @@ -777,7 +777,7 @@ inline bool check_underflow(T val, R* result, const char* function, const Policy { if((val != 0) && (static_cast(val) == 0)) { - *result = static_cast(boost::math::policies::detail::raise_underflow_error(function, 0, pol)); + *result = static_cast(boost::math::policies::detail::raise_underflow_error(function, nullptr, pol)); return true; } return false; diff --git a/include/boost/math/special_functions/beta.hpp b/include/boost/math/special_functions/beta.hpp index 04a364be2..d1ce5a246 100644 --- a/include/boost/math/special_functions/beta.hpp +++ b/include/boost/math/special_functions/beta.hpp @@ -1467,7 +1467,7 @@ inline typename tools::promote_args::type beta(RT1 a, RT2 b, A arg) { typedef typename policies::is_policy::type tag; - return boost::math::detail::beta(a, b, arg, static_cast(0)); + return boost::math::detail::beta(a, b, arg, static_cast(nullptr)); } template diff --git a/include/boost/math/special_functions/detail/bessel_jn.hpp b/include/boost/math/special_functions/detail/bessel_jn.hpp index c63e39bb0..3388e8df2 100644 --- a/include/boost/math/special_functions/detail/bessel_jn.hpp +++ b/include/boost/math/special_functions/detail/bessel_jn.hpp @@ -122,7 +122,7 @@ T bessel_jn(int n, T x, const Policy& pol) value *= factor; if(tools::max_value() * scale < fabs(value)) - return policies::raise_overflow_error("boost::math::bessel_jn<%1%>(%1%,%1%)", 0, pol); + return policies::raise_overflow_error("boost::math::bessel_jn<%1%>(%1%,%1%)", nullptr, pol); return value / scale; } diff --git a/include/boost/math/special_functions/detail/erf_inv.hpp b/include/boost/math/special_functions/detail/erf_inv.hpp index f4a68cf12..94e36e385 100644 --- a/include/boost/math/special_functions/detail/erf_inv.hpp +++ b/include/boost/math/special_functions/detail/erf_inv.hpp @@ -15,7 +15,7 @@ #include -namespace boost{ namespace math{ +namespace boost{ namespace math{ namespace detail{ // @@ -28,7 +28,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_STD_USING // for ADL of std names. T result = 0; - + if(p <= 0.5) { // @@ -44,7 +44,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan // Maximum Deviation Found (actual error term at infinite precision) 8.030e-21 // static const float Y = 0.0891314744949340820313f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.000508781949658280665617), BOOST_MATH_BIG_CONSTANT(T, 64, -0.00836874819741736770379), BOOST_MATH_BIG_CONSTANT(T, 64, 0.0334806625409744615033), @@ -54,7 +54,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, 0.00822687874676915743155), BOOST_MATH_BIG_CONSTANT(T, 64, -0.00538772965071242932965) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, -0.970005043303290640362), BOOST_MATH_BIG_CONSTANT(T, 64, -1.56574558234175846809), @@ -85,7 +85,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan // Maximum Deviation Found (error term) 4.811e-20 // static const float Y = 2.249481201171875f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.202433508355938759655), BOOST_MATH_BIG_CONSTANT(T, 64, 0.105264680699391713268), BOOST_MATH_BIG_CONSTANT(T, 64, 8.37050328343119927838), @@ -96,7 +96,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, 21.1294655448340526258), BOOST_MATH_BIG_CONSTANT(T, 64, -3.67192254707729348546) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, 6.24264124854247537712), BOOST_MATH_BIG_CONSTANT(T, 64, 3.9713437953343869095), @@ -124,7 +124,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan // // x(Y+R(x-B)) // - // where Y is a constant, B is the lowest value of x for which + // where Y is a constant, B is the lowest value of x for which // the approximation is valid, and R(x-B) is optimised for a low // absolute error compared to Y. // @@ -138,7 +138,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan { // Max error found: 1.089051e-20 static const float Y = 0.807220458984375f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.131102781679951906451), BOOST_MATH_BIG_CONSTANT(T, 64, -0.163794047193317060787), BOOST_MATH_BIG_CONSTANT(T, 64, 0.117030156341995252019), @@ -151,7 +151,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, 0.285225331782217055858e-7), BOOST_MATH_BIG_CONSTANT(T, 64, -0.681149956853776992068e-9) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, 3.46625407242567245975), BOOST_MATH_BIG_CONSTANT(T, 64, 5.38168345707006855425), @@ -169,7 +169,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan { // Max error found: 8.389174e-21 static const float Y = 0.93995571136474609375f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.0350353787183177984712), BOOST_MATH_BIG_CONSTANT(T, 64, -0.00222426529213447927281), BOOST_MATH_BIG_CONSTANT(T, 64, 0.0185573306514231072324), @@ -180,7 +180,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, -0.230404776911882601748e-9), BOOST_MATH_BIG_CONSTANT(T, 64, 0.266339227425782031962e-11) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, 1.3653349817554063097), BOOST_MATH_BIG_CONSTANT(T, 64, 0.762059164553623404043), @@ -197,7 +197,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan { // Max error found: 1.481312e-19 static const float Y = 0.98362827301025390625f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.0167431005076633737133), BOOST_MATH_BIG_CONSTANT(T, 64, -0.00112951438745580278863), BOOST_MATH_BIG_CONSTANT(T, 64, 0.00105628862152492910091), @@ -208,7 +208,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, -0.281128735628831791805e-13), BOOST_MATH_BIG_CONSTANT(T, 64, 0.99055709973310326855e-16) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, 0.591429344886417493481), BOOST_MATH_BIG_CONSTANT(T, 64, 0.138151865749083321638), @@ -225,7 +225,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan { // Max error found: 5.697761e-20 static const float Y = 0.99714565277099609375f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.0024978212791898131227), BOOST_MATH_BIG_CONSTANT(T, 64, -0.779190719229053954292e-5), BOOST_MATH_BIG_CONSTANT(T, 64, 0.254723037413027451751e-4), @@ -235,7 +235,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, 0.145596286718675035587e-11), BOOST_MATH_BIG_CONSTANT(T, 64, -0.116765012397184275695e-17) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, 0.207123112214422517181), BOOST_MATH_BIG_CONSTANT(T, 64, 0.0169410838120975906478), @@ -252,7 +252,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan { // Max error found: 1.279746e-20 static const float Y = 0.99941349029541015625f; - static const T P[] = { + static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -0.000539042911019078575891), BOOST_MATH_BIG_CONSTANT(T, 64, -0.28398759004727721098e-6), BOOST_MATH_BIG_CONSTANT(T, 64, 0.899465114892291446442e-6), @@ -262,7 +262,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy&, const std::integral_constan BOOST_MATH_BIG_CONSTANT(T, 64, 0.135880130108924861008e-14), BOOST_MATH_BIG_CONSTANT(T, 64, -0.348890393399948882918e-21) }; - static const T Q[] = { + static const T Q[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 1.0), BOOST_MATH_BIG_CONSTANT(T, 64, 0.0845746234001899436914), BOOST_MATH_BIG_CONSTANT(T, 64, 0.00282092984726264681981), @@ -301,7 +301,7 @@ T erf_inv_imp(const T& p, const T& q, const Policy& pol, const std::integral_con // // Generic version, get a guess that's accurate to 64-bits (10^-19) // - T guess = erf_inv_imp(p, q, pol, static_cast const*>(0)); + T guess = erf_inv_imp(p, q, pol, static_cast const*>(nullptr)); T result; // // If T has more bit's than 64 in it's mantissa then we need to iterate, @@ -406,9 +406,9 @@ typename tools::promote_args::type erfc_inv(T z, const Policy& pol) if((z < 0) || (z > 2)) return policies::raise_domain_error(function, "Argument outside range [0,2] in inverse erfc function (got p=%1%).", z, pol); if(z == 0) - return policies::raise_overflow_error(function, 0, pol); + return policies::raise_overflow_error(function, nullptr, pol); if(z == 2) - return -policies::raise_overflow_error(function, 0, pol); + return -policies::raise_overflow_error(function, nullptr, pol); // // Normalise the input, so it's in the range [0,1], we will // negate the result if z is outside that range. This is a simple @@ -442,9 +442,9 @@ typename tools::promote_args::type erfc_inv(T z, const Policy& pol) // typedef typename policies::evaluation::type eval_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; @@ -454,7 +454,7 @@ typename tools::promote_args::type erfc_inv(T z, const Policy& pol) // And get the result, negating where required: // return s * policies::checked_narrowing_cast( - detail::erf_inv_imp(static_cast(p), static_cast(q), forwarding_policy(), static_cast(0)), function); + detail::erf_inv_imp(static_cast(p), static_cast(q), forwarding_policy(), static_cast(nullptr)), function); } template @@ -469,9 +469,9 @@ typename tools::promote_args::type erf_inv(T z, const Policy& pol) if((z < -1) || (z > 1)) return policies::raise_domain_error(function, "Argument outside range [-1, 1] in inverse erf function (got p=%1%).", z, pol); if(z == 1) - return policies::raise_overflow_error(function, 0, pol); + return policies::raise_overflow_error(function, nullptr, pol); if(z == -1) - return -policies::raise_overflow_error(function, 0, pol); + return -policies::raise_overflow_error(function, nullptr, pol); if(z == 0) return 0; // @@ -507,9 +507,9 @@ typename tools::promote_args::type erf_inv(T z, const Policy& pol) // typedef typename policies::evaluation::type eval_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; // @@ -523,7 +523,7 @@ typename tools::promote_args::type erf_inv(T z, const Policy& pol) // And get the result, negating where required: // return s * policies::checked_narrowing_cast( - detail::erf_inv_imp(static_cast(p), static_cast(q), forwarding_policy(), static_cast(0)), function); + detail::erf_inv_imp(static_cast(p), static_cast(q), forwarding_policy(), static_cast(nullptr)), function); } template diff --git a/include/boost/math/special_functions/detail/gamma_inva.hpp b/include/boost/math/special_functions/detail/gamma_inva.hpp index 48b8f4938..75ac89e43 100644 --- a/include/boost/math/special_functions/detail/gamma_inva.hpp +++ b/include/boost/math/special_functions/detail/gamma_inva.hpp @@ -75,7 +75,7 @@ T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol) // if(p == 0) { - return policies::raise_overflow_error("boost::math::gamma_p_inva<%1%>(%1%, %1%)", 0, Policy()); + return policies::raise_overflow_error("boost::math::gamma_p_inva<%1%>(%1%, %1%)", nullptr, Policy()); } if(q == 0) { @@ -91,7 +91,7 @@ T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol) // tools::eps_tolerance tol(policies::digits()); // - // Now figure out a starting guess for what a may be, + // Now figure out a starting guess for what a may be, // we'll start out with a value that'll put p or q // right bang in the middle of their range, the functions // are quite sensitive so we should need too many steps @@ -102,7 +102,7 @@ T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol) if(z >= 1) { // - // We can use the relationship between the incomplete + // We can use the relationship between the incomplete // gamma function and the poisson distribution to // calculate an approximate inverse, for large z // this is actually pretty accurate, but it fails badly @@ -151,21 +151,21 @@ T gamma_inva_imp(const T& z, const T& p, const T& q, const Policy& pol) } // namespace detail template -inline typename tools::promote_args::type +inline typename tools::promote_args::type gamma_p_inva(T1 x, T2 p, const Policy& pol) { typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; if(p == 0) { - policies::raise_overflow_error("boost::math::gamma_p_inva<%1%>(%1%, %1%)", 0, Policy()); + policies::raise_overflow_error("boost::math::gamma_p_inva<%1%>(%1%, %1%)", nullptr, Policy()); } if(p == 1) { @@ -174,28 +174,28 @@ inline typename tools::promote_args::type return policies::checked_narrowing_cast( detail::gamma_inva_imp( - static_cast(x), - static_cast(p), - static_cast(1 - static_cast(p)), + static_cast(x), + static_cast(p), + static_cast(1 - static_cast(p)), pol), "boost::math::gamma_p_inva<%1%>(%1%, %1%)"); } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type gamma_q_inva(T1 x, T2 q, const Policy& pol) { typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; if(q == 1) { - policies::raise_overflow_error("boost::math::gamma_q_inva<%1%>(%1%, %1%)", 0, Policy()); + policies::raise_overflow_error("boost::math::gamma_q_inva<%1%>(%1%, %1%)", nullptr, Policy()); } if(q == 0) { @@ -204,14 +204,14 @@ inline typename tools::promote_args::type return policies::checked_narrowing_cast( detail::gamma_inva_imp( - static_cast(x), - static_cast(1 - static_cast(q)), - static_cast(q), + static_cast(x), + static_cast(1 - static_cast(q)), + static_cast(q), pol), "boost::math::gamma_q_inva<%1%>(%1%, %1%)"); } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type gamma_p_inva(T1 x, T2 p) { return boost::math::gamma_p_inva(x, p, policies::policy<>()); diff --git a/include/boost/math/special_functions/detail/ibeta_inverse.hpp b/include/boost/math/special_functions/detail/ibeta_inverse.hpp index 195f6abe1..c08652740 100644 --- a/include/boost/math/special_functions/detail/ibeta_inverse.hpp +++ b/include/boost/math/special_functions/detail/ibeta_inverse.hpp @@ -421,7 +421,7 @@ struct ibeta_roots BOOST_MATH_STD_USING // ADL of std names BOOST_FPU_EXCEPTION_GUARD - + T f1; T y = 1 - x; T f = ibeta_imp(a, b, x, Policy(), invert, true, &f1) - target; @@ -491,7 +491,7 @@ T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py) T x = 0; // Set to a safe zero to avoid a // MSVC 2005 warning C4701: potentially uninitialized local variable 'x' used // But code inspection appears to ensure that x IS assigned whatever the code path. - T y; + T y; // For some of the methods we can put tighter bounds // on the result than simply [0,1]: @@ -638,7 +638,7 @@ T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py) y = pow(b * q * bet, 1/b); x = 1 - y; } - else + else y = 1; if(y > 1e-5) { @@ -869,7 +869,7 @@ T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py) // thrash around and convergence may be slow in this case. // Try 3/4 of machine epsilon: // - digits *= 3; + digits *= 3; digits /= 2; } // @@ -899,7 +899,7 @@ T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py) } // namespace detail template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol) { static const char* function = "boost::math::ibeta_inv<%1%>(%1%,%1%,%1%)"; @@ -907,9 +907,9 @@ inline typename tools::promote_args::type typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; @@ -934,30 +934,30 @@ inline typename tools::promote_args::type } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibeta_inv(T1 a, T2 b, T3 p, T4* py) { return ibeta_inv(a, b, p, py, policies::policy<>()); } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibeta_inv(T1 a, T2 b, T3 p) { typedef typename tools::promote_args::type result_type; - return ibeta_inv(a, b, p, static_cast(0), policies::policy<>()); + return ibeta_inv(a, b, p, static_cast(nullptr), policies::policy<>()); } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibeta_inv(T1 a, T2 b, T3 p, const Policy& pol) { typedef typename tools::promote_args::type result_type; - return ibeta_inv(a, b, p, static_cast(0), pol); + return ibeta_inv(a, b, p, static_cast(nullptr), pol); } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol) { static const char* function = "boost::math::ibetac_inv<%1%>(%1%,%1%,%1%)"; @@ -965,9 +965,9 @@ inline typename tools::promote_args::type typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; @@ -992,18 +992,18 @@ inline typename tools::promote_args::type } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibetac_inv(T1 a, T2 b, T3 q, T4* py) { return ibetac_inv(a, b, q, py, policies::policy<>()); } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type ibetac_inv(RT1 a, RT2 b, RT3 q) { typedef typename tools::promote_args::type result_type; - return ibetac_inv(a, b, q, static_cast(0), policies::policy<>()); + return ibetac_inv(a, b, q, static_cast(nullptr), policies::policy<>()); } template @@ -1011,7 +1011,7 @@ inline typename tools::promote_args::type ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy& pol) { typedef typename tools::promote_args::type result_type; - return ibetac_inv(a, b, q, static_cast(0), pol); + return ibetac_inv(a, b, q, static_cast(nullptr), pol); } } // namespace math diff --git a/include/boost/math/special_functions/detail/t_distribution_inv.hpp b/include/boost/math/special_functions/detail/t_distribution_inv.hpp index 6ad7ed6d9..bcbad38fc 100644 --- a/include/boost/math/special_functions/detail/t_distribution_inv.hpp +++ b/include/boost/math/special_functions/detail/t_distribution_inv.hpp @@ -146,37 +146,37 @@ T inverse_students_t_body_series(T df, T u, const Policy& pol) T in = 1 / df; c[2] = static_cast(0.16666666666666666667 + 0.16666666666666666667 * in); c[3] = static_cast((0.0083333333333333333333 * in - + 0.066666666666666666667) * in + + 0.066666666666666666667) * in + 0.058333333333333333333); c[4] = static_cast(((0.00019841269841269841270 * in - + 0.0017857142857142857143) * in - + 0.026785714285714285714) * in + + 0.0017857142857142857143) * in + + 0.026785714285714285714) * in + 0.025198412698412698413); c[5] = static_cast((((2.7557319223985890653e-6 * in - + 0.00037477954144620811287) * in - - 0.0011078042328042328042) * in - + 0.010559964726631393298) * in + + 0.00037477954144620811287) * in + - 0.0011078042328042328042) * in + + 0.010559964726631393298) * in + 0.012039792768959435626); c[6] = static_cast(((((2.5052108385441718775e-8 * in - - 0.000062705427288760622094) * in - + 0.00059458674042007375341) * in - - 0.0016095979637646304313) * in - + 0.0061039211560044893378) * in + - 0.000062705427288760622094) * in + + 0.00059458674042007375341) * in + - 0.0016095979637646304313) * in + + 0.0061039211560044893378) * in + 0.0038370059724226390893); c[7] = static_cast((((((1.6059043836821614599e-10 * in - + 0.000015401265401265401265) * in + + 0.000015401265401265401265) * in - 0.00016376804137220803887) * in - + 0.00069084207973096861986) * in - - 0.0012579159844784844785) * in - + 0.0010898206731540064873) * in + + 0.00069084207973096861986) * in + - 0.0012579159844784844785) * in + + 0.0010898206731540064873) * in + 0.0032177478835464946576); c[8] = static_cast(((((((7.6471637318198164759e-13 * in - 3.9851014346715404916e-6) * in + 0.000049255746366361445727) * in - - 0.00024947258047043099953) * in + - 0.00024947258047043099953) * in + 0.00064513046951456342991) * in - 0.00076245135440323932387) * in - + 0.000033530976880017885309) * in + + 0.000033530976880017885309) * in + 0.0017438262298340009980); c[9] = static_cast((((((((2.8114572543455207632e-15 * in + 1.0914179173496789432e-6) * in @@ -185,7 +185,7 @@ T inverse_students_t_body_series(T df, T u, const Policy& pol) - 0.00029133414466938067350) * in + 0.00051406605788341121363) * in - 0.00036307660358786885787) * in - - 0.00031101086326318780412) * in + - 0.00031101086326318780412) * in + 0.00096472747321388644237); c[10] = static_cast(((((((((8.2206352466243297170e-18 * in - 3.1239569599829868045e-7) * in @@ -438,7 +438,7 @@ inline T fast_students_t_quantile_imp(T df, T p, const Policy& pol, const std::f T t, x, y(0); x = ibeta_inv(df / 2, T(0.5), 2 * probability, &y, pol); if(df * y > tools::max_value() * x) - t = policies::raise_overflow_error("boost::math::students_t_quantile<%1%>(%1%,%1%)", 0, pol); + t = policies::raise_overflow_error("boost::math::students_t_quantile<%1%>(%1%,%1%)", nullptr, pol); else t = sqrt(df * y / x); // @@ -455,7 +455,7 @@ T fast_students_t_quantile_imp(T df, T p, const Policy& pol, const std::true_typ BOOST_MATH_STD_USING bool invert = false; if((df < 2) && (floor(df) != df)) - return boost::math::detail::fast_students_t_quantile_imp(df, p, pol, static_cast(0)); + return boost::math::detail::fast_students_t_quantile_imp(df, p, pol, static_cast(nullptr)); if(p > 0.5) { p = 1 - p; @@ -525,9 +525,9 @@ inline T fast_students_t_quantile(T df, T p, const Policy& pol) { typedef typename policies::evaluation::type value_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; @@ -538,7 +538,7 @@ inline T fast_students_t_quantile(T df, T p, const Policy& pol) && (std::numeric_limits::radix == 2) > tag_type; - return policies::checked_narrowing_cast(fast_students_t_quantile_imp(static_cast(df), static_cast(p), pol, static_cast(0)), "boost::math::students_t_quantile<%1%>(%1%,%1%,%1%)"); + return policies::checked_narrowing_cast(fast_students_t_quantile_imp(static_cast(df), static_cast(p), pol, static_cast(nullptr)), "boost::math::students_t_quantile<%1%>(%1%,%1%,%1%)"); } }}} // namespaces diff --git a/include/boost/math/special_functions/ellint_2.hpp b/include/boost/math/special_functions/ellint_2.hpp index cd4380941..d5cd094d9 100644 --- a/include/boost/math/special_functions/ellint_2.hpp +++ b/include/boost/math/special_functions/ellint_2.hpp @@ -30,11 +30,11 @@ // Elliptic integrals (complete and incomplete) of the second kind // Carlson, Numerische Mathematik, vol 33, 1 (1979) -namespace boost { namespace math { - +namespace boost { namespace math { + template typename tools::promote_args::type ellint_2(T1 k, T2 phi, const Policy& pol); - + namespace detail{ template @@ -63,7 +63,7 @@ T ellint_e_imp(T phi, T k, const Policy& pol) if(phi >= tools::max_value()) { // Need to handle infinity as a special case: - result = policies::raise_overflow_error("boost::math::ellint_e<%1%>(%1%,%1%)", 0, pol); + result = policies::raise_overflow_error("boost::math::ellint_e<%1%>(%1%,%1%)", nullptr, pol); } else if(phi > 1 / tools::epsilon()) { diff --git a/include/boost/math/special_functions/ellint_d.hpp b/include/boost/math/special_functions/ellint_d.hpp index 8b6c24245..d50029f5f 100644 --- a/include/boost/math/special_functions/ellint_d.hpp +++ b/include/boost/math/special_functions/ellint_d.hpp @@ -30,11 +30,11 @@ // Elliptic integrals (complete and incomplete) of the second kind // Carlson, Numerische Mathematik, vol 33, 1 (1979) -namespace boost { namespace math { - +namespace boost { namespace math { + template typename tools::promote_args::type ellint_d(T1 k, T2 phi, const Policy& pol); - + namespace detail{ template @@ -60,7 +60,7 @@ T ellint_d_imp(T phi, T k, const Policy& pol) if(phi >= tools::max_value()) { // Need to handle infinity as a special case: - result = policies::raise_overflow_error("boost::math::ellint_d<%1%>(%1%,%1%)", 0, pol); + result = policies::raise_overflow_error("boost::math::ellint_d<%1%>(%1%,%1%)", nullptr, pol); } else if(phi > 1 / tools::epsilon()) { diff --git a/include/boost/math/special_functions/fpclassify.hpp b/include/boost/math/special_functions/fpclassify.hpp index 09fcf2924..47d2a0e79 100644 --- a/include/boost/math/special_functions/fpclassify.hpp +++ b/include/boost/math/special_functions/fpclassify.hpp @@ -128,7 +128,7 @@ inline bool is_nan_helper(T, const std::false_type&) { return false; } -#if defined(BOOST_MATH_USE_FLOAT128) +#if defined(BOOST_MATH_USE_FLOAT128) #if defined(BOOST_MATH_HAS_QUADMATH_H) inline bool is_nan_helper(__float128 f, const std::true_type&) { return ::isnanq(f); } inline bool is_nan_helper(__float128 f, const std::false_type&) { return ::isnanq(f); } @@ -279,7 +279,7 @@ inline int fpclassify BOOST_NO_MACRO_EXPAND(T t) typedef typename traits::method method; typedef typename tools::promote_args_permissive::type value_type; #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - if(std::numeric_limits::is_specialized && detail::is_generic_tag_false(static_cast(0))) + if(std::numeric_limits::is_specialized && detail::is_generic_tag_false(static_cast(nullptr))) return detail::fpclassify_imp(static_cast(t), detail::generic_tag()); return detail::fpclassify_imp(static_cast(t), method()); #else @@ -295,7 +295,7 @@ inline int fpclassify BOOST_NO_MACRO_EXPAND(long double t) typedef traits::method method; typedef long double value_type; #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - if(std::numeric_limits::is_specialized && detail::is_generic_tag_false(static_cast(0))) + if(std::numeric_limits::is_specialized && detail::is_generic_tag_false(static_cast(nullptr))) return detail::fpclassify_imp(static_cast(t), detail::generic_tag()); return detail::fpclassify_imp(static_cast(t), method()); #else diff --git a/include/boost/math/special_functions/gamma.hpp b/include/boost/math/special_functions/gamma.hpp index 837d00558..7a786b872 100644 --- a/include/boost/math/special_functions/gamma.hpp +++ b/include/boost/math/special_functions/gamma.hpp @@ -709,7 +709,7 @@ T lgamma_imp(T z, const Policy& pol, const lanczos::undefined_lanczos&, int* sig - log(t); } - if(sign != static_cast(0U)) { *sign = sign_of_result; } + if(sign != static_cast(nullptr)) { *sign = sign_of_result; } return log_gamma_value; } @@ -1218,7 +1218,7 @@ T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, return exp(result); } - BOOST_MATH_ASSERT((p_derivative == 0) || normalised); + BOOST_MATH_ASSERT((p_derivative == nullptr) || normalised); bool is_int, is_half_int; bool is_small_a = (a < 30) && (a <= x + 1) && (x < tools::log_max_value()); @@ -1450,7 +1450,7 @@ T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, precision_type::value <= 113 ? 113 : 0 > tag_type; - result = igamma_temme_large(a, x, pol, static_cast(0)); + result = igamma_temme_large(a, x, pol, static_cast(nullptr)); if(x >= a) invert = !invert; if(p_derivative) @@ -1787,7 +1787,7 @@ T gamma_p_derivative_imp(T a, T x, const Policy& pol) if(x == 0) { return (a > 1) ? 0 : - (a == 1) ? 1 : policies::raise_overflow_error("boost::math::gamma_p_derivative<%1%>(%1%, %1%)", 0, pol); + (a == 1) ? 1 : policies::raise_overflow_error("boost::math::gamma_p_derivative<%1%>(%1%, %1%)", nullptr, pol); } // // Normal case: @@ -1797,7 +1797,7 @@ T gamma_p_derivative_imp(T a, T x, const Policy& pol) if((x < 1) && (tools::max_value() * x < f1)) { // overflow: - return policies::raise_overflow_error("boost::math::gamma_p_derivative<%1%>(%1%, %1%)", 0, pol); + return policies::raise_overflow_error("boost::math::gamma_p_derivative<%1%>(%1%, %1%)", nullptr, pol); } if(f1 == 0) { diff --git a/include/boost/math/special_functions/hypot.hpp b/include/boost/math/special_functions/hypot.hpp index bfa797de8..c56c75110 100644 --- a/include/boost/math/special_functions/hypot.hpp +++ b/include/boost/math/special_functions/hypot.hpp @@ -31,14 +31,14 @@ T hypot_imp(T x, T y, const Policy& pol) y = fabs(y); #ifdef _MSC_VER -#pragma warning(push) +#pragma warning(push) #pragma warning(disable: 4127) #endif // special case, see C99 Annex F: if(std::numeric_limits::has_infinity && ((x == std::numeric_limits::infinity()) || (y == std::numeric_limits::infinity()))) - return policies::raise_overflow_error("boost::math::hypot<%1%>(%1%,%1%)", 0, pol); + return policies::raise_overflow_error("boost::math::hypot<%1%>(%1%,%1%)", nullptr, pol); #ifdef _MSC_VER #pragma warning(pop) #endif @@ -56,7 +56,7 @@ T hypot_imp(T x, T y, const Policy& pol) } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type hypot(T1 x, T2 y) { typedef typename tools::promote_args::type result_type; @@ -65,7 +65,7 @@ inline typename tools::promote_args::type } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type hypot(T1 x, T2 y, const Policy& pol) { typedef typename tools::promote_args::type result_type; diff --git a/include/boost/math/special_functions/jacobi_elliptic.hpp b/include/boost/math/special_functions/jacobi_elliptic.hpp index 156a66cd1..88d8b9dac 100644 --- a/include/boost/math/special_functions/jacobi_elliptic.hpp +++ b/include/boost/math/special_functions/jacobi_elliptic.hpp @@ -123,9 +123,9 @@ inline typename tools::promote_args::type jacobi_elliptic(T k, U theta, typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; typedef typename policies::normalise< - Policy, - policies::promote_float, - policies::promote_double, + Policy, + policies::promote_float, + policies::promote_double, policies::discrete_quantile<>, policies::assert_undefined<> >::type forwarding_policy; @@ -150,7 +150,7 @@ template inline typename tools::promote_args::type jacobi_sn(U k, T theta, const Policy& pol) { typedef typename tools::promote_args::type result_type; - return jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(0), static_cast(0), pol); + return jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(nullptr), static_cast(nullptr), pol); } template @@ -164,7 +164,7 @@ inline typename tools::promote_args::type jacobi_cn(T k, U theta, const Po { typedef typename tools::promote_args::type result_type; result_type cn; - jacobi_elliptic(static_cast(k), static_cast(theta), &cn, static_cast(0), pol); + jacobi_elliptic(static_cast(k), static_cast(theta), &cn, static_cast(nullptr), pol); return cn; } @@ -179,7 +179,7 @@ inline typename tools::promote_args::type jacobi_dn(T k, U theta, const Po { typedef typename tools::promote_args::type result_type; result_type dn; - jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(0), &dn, pol); + jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(nullptr), &dn, pol); return dn; } @@ -223,7 +223,7 @@ template inline typename tools::promote_args::type jacobi_ns(T k, U theta, const Policy& pol) { typedef typename tools::promote_args::type result_type; - return 1 / jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(0), static_cast(0), pol); + return 1 / jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(nullptr), static_cast(nullptr), pol); } template @@ -237,7 +237,7 @@ inline typename tools::promote_args::type jacobi_sd(T k, U theta, const Po { typedef typename tools::promote_args::type result_type; result_type sn, dn; - sn = jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(0), &dn, pol); + sn = jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(nullptr), &dn, pol); return sn / dn; } @@ -252,7 +252,7 @@ inline typename tools::promote_args::type jacobi_ds(T k, U theta, const Po { typedef typename tools::promote_args::type result_type; result_type sn, dn; - sn = jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(0), &dn, pol); + sn = jacobi_elliptic(static_cast(k), static_cast(theta), static_cast(nullptr), &dn, pol); return dn / sn; } @@ -291,7 +291,7 @@ inline typename tools::promote_args::type jacobi_sc(T k, U theta, const Po { typedef typename tools::promote_args::type result_type; result_type sn, cn; - sn = jacobi_elliptic(static_cast(k), static_cast(theta), &cn, static_cast(0), pol); + sn = jacobi_elliptic(static_cast(k), static_cast(theta), &cn, static_cast(nullptr), pol); return sn / cn; } @@ -306,7 +306,7 @@ inline typename tools::promote_args::type jacobi_cs(T k, U theta, const Po { typedef typename tools::promote_args::type result_type; result_type sn, cn; - sn = jacobi_elliptic(static_cast(k), static_cast(theta), &cn, static_cast(0), pol); + sn = jacobi_elliptic(static_cast(k), static_cast(theta), &cn, static_cast(nullptr), pol); return cn / sn; } diff --git a/include/boost/math/special_functions/log1p.hpp b/include/boost/math/special_functions/log1p.hpp index 20b2e5a5a..49588ddc5 100644 --- a/include/boost/math/special_functions/log1p.hpp +++ b/include/boost/math/special_functions/log1p.hpp @@ -91,7 +91,7 @@ T log1p_imp(T const & x, const Policy& pol, const std::integral_constant function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); if(x == -1) return -policies::raise_overflow_error( - function, 0, pol); + function, nullptr, pol); result_type a = abs(result_type(x)); if(a > result_type(0.5f)) @@ -121,7 +121,7 @@ T log1p_imp(T const& x, const Policy& pol, const std::integral_constant function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); if(x == -1) return -policies::raise_overflow_error( - function, 0, pol); + function, nullptr, pol); T a = fabs(x); if(a > 0.5f) @@ -174,7 +174,7 @@ T log1p_imp(T const& x, const Policy& pol, const std::integral_constant function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); if(x == -1) return -policies::raise_overflow_error( - function, 0, pol); + function, nullptr, pol); T a = fabs(x); if(a > 0.5f) @@ -229,7 +229,7 @@ T log1p_imp(T const& x, const Policy& pol, const std::integral_constant function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); if(x == -1) return -policies::raise_overflow_error( - function, 0, pol); + function, nullptr, pol); T a = fabs(x); if(a > 0.5f) @@ -445,7 +445,7 @@ inline typename tools::promote_args::type function, "log1pmx(x) requires x > -1, but got x = %1%.", x, pol); if(x == -1) return -policies::raise_overflow_error( - function, 0, pol); + function, nullptr, pol); result_type a = abs(result_type(x)); if(a > result_type(0.95f)) diff --git a/include/boost/math/special_functions/next.hpp b/include/boost/math/special_functions/next.hpp index ef68d894d..07c55e8d4 100644 --- a/include/boost/math/special_functions/next.hpp +++ b/include/boost/math/special_functions/next.hpp @@ -302,7 +302,7 @@ inline double float_next(const double& val, const Policy& pol) "Argument must be finite, but got %1%", val, pol); if(val >= tools::max_value()) - return policies::raise_overflow_error(function, 0, pol); + return policies::raise_overflow_error(function, nullptr, pol); return ::_nextafter(val, tools::max_value()); } @@ -438,7 +438,7 @@ inline double float_prior(const double& val, const Policy& pol) "Argument must be finite, but got %1%", val, pol); if(val <= -tools::max_value()) - return -policies::raise_overflow_error(function, 0, pol); + return -policies::raise_overflow_error(function, nullptr, pol); return ::_nextafter(val, -tools::max_value()); } diff --git a/include_private/boost/math/tools/test.hpp b/include_private/boost/math/tools/test.hpp index f71270a53..633082809 100644 --- a/include_private/boost/math/tools/test.hpp +++ b/include_private/boost/math/tools/test.hpp @@ -304,7 +304,7 @@ void test_check_throw(Val v, boost::math::rounding_error const*) // but to keep things simple we really need it somewhere that's always included: // #ifdef BOOST_NO_EXCEPTIONS -# define BOOST_MATH_CHECK_THROW(x, ExceptionType) boost::math::tools::test_check_throw(x, static_cast(0)); +# define BOOST_MATH_CHECK_THROW(x, ExceptionType) boost::math::tools::test_check_throw(x, static_cast(nullptr)); #else # define BOOST_MATH_CHECK_THROW(x, y) BOOST_CHECK_THROW(x, y) #endif