Ticket #8732: math_macro.patch
File math_macro.patch, 43.3 KB (added by , 9 years ago) |
---|
-
boost/math/distributions/students_t.hpp
93 93 return error_result; 94 94 95 95 RealType result; 96 if ( boost::math::isinf(x))96 if ((boost::math::isinf)(x)) 97 97 { // +infinity. 98 98 normal_distribution<RealType, Policy> n(0, 1); 99 99 RealType result = pdf(n, x); … … 144 144 { // Special case with exact result. 145 145 return static_cast<RealType>(0.5); 146 146 } 147 if ( boost::math::isinf(x))147 if ((boost::math::isinf)(x)) 148 148 { // +infinity. 149 149 normal_distribution<RealType, Policy> n(0, 1); 150 150 RealType result = cdf(n, x); … … 376 376 df, Policy()); 377 377 return std::numeric_limits<RealType>::quiet_NaN(); // Undefined. 378 378 } 379 if ( boost::math::isinf(df))379 if ((boost::math::isinf)(df)) 380 380 { // +infinity. 381 381 return 1; 382 382 } … … 422 422 df, Policy()); 423 423 return std::numeric_limits<RealType>::quiet_NaN(); // Undefined. 424 424 } 425 if ( boost::math::isinf(df))425 if ((boost::math::isinf)(df)) 426 426 { // +infinity. 427 427 return 3; 428 428 } … … 456 456 df, Policy()); 457 457 return std::numeric_limits<RealType>::quiet_NaN(); // Undefined. 458 458 } 459 if ( boost::math::isinf(df))459 if ((boost::math::isinf)(df)) 460 460 { // +infinity. 461 461 return 0; 462 462 } -
boost/math/distributions/non_central_t.hpp
206 206 T non_central_t_cdf(T v, T delta, T t, bool invert, const Policy& pol) 207 207 { 208 208 BOOST_MATH_STD_USING 209 if ( boost::math::isinf(v))209 if ((boost::math::isinf)(v)) 210 210 { // Infinite degrees of freedom, so use normal distribution located at delta. 211 211 normal_distribution<T, Policy> n(delta, 1); 212 212 return cdf(n, t); … … 320 320 321 321 322 322 value_type guess = 0; 323 if ( ( boost::math::isinf(v)) || (v > 1 / boost::math::tools::epsilon<T>()) )323 if ( ((boost::math::isinf)(v)) || (v > 1 / boost::math::tools::epsilon<T>()) ) 324 324 { // Infinite or very large degrees of freedom, so use normal distribution located at delta. 325 325 normal_distribution<T, Policy> n(delta, 1); 326 326 if (p < q) … … 447 447 T non_central_t_pdf(T n, T delta, T t, const Policy& pol) 448 448 { 449 449 BOOST_MATH_STD_USING 450 if ( boost::math::isinf(n))450 if ((boost::math::isinf)(n)) 451 451 { // Infinite degrees of freedom, so use normal distribution located at delta. 452 452 normal_distribution<T, Policy> n(delta, 1); 453 453 return pdf(n, t); … … 515 515 template <class T, class Policy> 516 516 T mean(T v, T delta, const Policy& pol) 517 517 { 518 if ( boost::math::isinf(v))518 if ((boost::math::isinf)(v)) 519 519 { 520 520 return delta; 521 521 } … … 536 536 template <class T, class Policy> 537 537 T variance(T v, T delta, const Policy& pol) 538 538 { 539 if ( boost::math::isinf(v))539 if ((boost::math::isinf)(v)) 540 540 { 541 541 return 1; 542 542 } … … 554 554 T skewness(T v, T delta, const Policy& pol) 555 555 { 556 556 BOOST_MATH_STD_USING 557 if ( boost::math::isinf(v))557 if ((boost::math::isinf)(v)) 558 558 { 559 559 return 0; 560 560 } … … 576 576 T kurtosis_excess(T v, T delta, const Policy& pol) 577 577 { 578 578 BOOST_MATH_STD_USING 579 if ( boost::math::isinf(v))579 if ((boost::math::isinf)(v)) 580 580 { 581 581 return 3; 582 582 } … … 1097 1097 &r, 1098 1098 Policy())) 1099 1099 return (RealType)r; 1100 if ( boost::math::isinf(v))1100 if ((boost::math::isinf)(v)) 1101 1101 { // Infinite degrees of freedom, so use normal distribution located at delta. 1102 1102 normal_distribution<RealType, Policy> n(l, 1); 1103 1103 cdf(n, x); … … 1152 1152 Policy())) 1153 1153 return (RealType)r; 1154 1154 1155 if ( boost::math::isinf(v))1155 if ((boost::math::isinf)(v)) 1156 1156 { // Infinite degrees of freedom, so use normal distribution located at delta. 1157 1157 normal_distribution<RealType, Policy> n(l, 1); 1158 1158 return cdf(complement(n, x)); -
boost/multiprecision/detail/default_ops.hpp
1117 1117 inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg) 1118 1118 { 1119 1119 typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type; 1120 return fpclassify(value_type(arg));1120 return (fpclassify)(value_type(arg)); 1121 1121 } 1122 1122 template <class Backend, multiprecision::expression_template_option ExpressionTemplates> 1123 1123 inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg) 1124 1124 { 1125 int v = fpclassify(arg);1125 int v = (fpclassify)(arg); 1126 1126 return (v != FP_INFINITE) && (v != FP_NAN); 1127 1127 } 1128 1128 template <class tag, class A1, class A2, class A3, class A4> 1129 1129 inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg) 1130 1130 { 1131 1131 typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type; 1132 return isfinite(value_type(arg));1132 return (isfinite)(value_type(arg)); 1133 1133 } 1134 1134 template <class Backend, multiprecision::expression_template_option ExpressionTemplates> 1135 1135 inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg) 1136 1136 { 1137 return fpclassify(arg) == FP_NAN;1137 return (fpclassify)(arg) == FP_NAN; 1138 1138 } 1139 1139 template <class tag, class A1, class A2, class A3, class A4> 1140 1140 inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg) 1141 1141 { 1142 1142 typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type; 1143 return isnan(value_type(arg));1143 return (isnan)(value_type(arg)); 1144 1144 } 1145 1145 template <class Backend, multiprecision::expression_template_option ExpressionTemplates> 1146 1146 inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg) 1147 1147 { 1148 return fpclassify(arg) == FP_INFINITE;1148 return (fpclassify)(arg) == FP_INFINITE; 1149 1149 } 1150 1150 template <class tag, class A1, class A2, class A3, class A4> 1151 1151 inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg) 1152 1152 { 1153 1153 typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type; 1154 return isinf(value_type(arg));1154 return (isinf)(value_type(arg)); 1155 1155 } 1156 1156 template <class Backend, multiprecision::expression_template_option ExpressionTemplates> 1157 1157 inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::number<Backend, ExpressionTemplates>& arg) 1158 1158 { 1159 return fpclassify(arg) == FP_NORMAL;1159 return (fpclassify)(arg) == FP_NORMAL; 1160 1160 } 1161 1161 template <class tag, class A1, class A2, class A3, class A4> 1162 1162 inline bool isnormal BOOST_PREVENT_MACRO_SUBSTITUTION(const multiprecision::detail::expression<tag, A1, A2, A3, A4>& arg) 1163 1163 { 1164 1164 typedef typename multiprecision::detail::expression<tag, A1, A2, A3, A4>::result_type value_type; 1165 return isnormal(value_type(arg));1165 return (isnormal)(value_type(arg)); 1166 1166 } 1167 1167 1168 1168 } // namespace math … … 1249 1249 { 1250 1250 typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type; 1251 1251 number_type r = trunc(v, pol); 1252 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || ! boost::math::isfinite(v))1252 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v)) 1253 1253 return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, number_type(v), 0, pol); 1254 1254 return r.template convert_to<int>(); 1255 1255 } … … 1262 1262 inline int itrunc(const number<Backend, ExpressionTemplates>& v, const Policy& pol) 1263 1263 { 1264 1264 number<Backend, ExpressionTemplates> r = trunc(v, pol); 1265 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || ! boost::math::isfinite(v))1265 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v)) 1266 1266 return boost::math::policies::raise_rounding_error("boost::multiprecision::itrunc<%1%>(%1%)", 0, v, 0, pol); 1267 1267 return r.template convert_to<int>(); 1268 1268 } … … 1276 1276 { 1277 1277 typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type; 1278 1278 number_type r = trunc(v, pol); 1279 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || ! boost::math::isfinite(v))1279 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v)) 1280 1280 return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, number_type(v), 0L, pol); 1281 1281 return r.template convert_to<long>(); 1282 1282 } … … 1289 1289 inline long ltrunc(const number<T, ExpressionTemplates>& v, const Policy& pol) 1290 1290 { 1291 1291 number<T, ExpressionTemplates> r = trunc(v, pol); 1292 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || ! boost::math::isfinite(v))1292 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v)) 1293 1293 return boost::math::policies::raise_rounding_error("boost::multiprecision::ltrunc<%1%>(%1%)", 0, v, 0L, pol); 1294 1294 return r.template convert_to<long>(); 1295 1295 } … … 1304 1304 { 1305 1305 typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type; 1306 1306 number_type r = trunc(v, pol); 1307 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || ! boost::math::isfinite(v))1307 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v)) 1308 1308 return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, number_type(v), 0LL, pol); 1309 1309 return r.template convert_to<long long>(); 1310 1310 } … … 1317 1317 inline long long lltrunc(const number<T, ExpressionTemplates>& v, const Policy& pol) 1318 1318 { 1319 1319 number<T, ExpressionTemplates> r = trunc(v, pol); 1320 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || ! boost::math::isfinite(v))1320 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v)) 1321 1321 return boost::math::policies::raise_rounding_error("boost::multiprecision::lltrunc<%1%>(%1%)", 0, v, 0LL, pol); 1322 1322 return r.template convert_to<long long>(); 1323 1323 } … … 1347 1347 { 1348 1348 typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type; 1349 1349 number_type r = round(v, pol); 1350 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || ! boost::math::isfinite(v))1350 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v)) 1351 1351 return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0, pol); 1352 1352 return r.template convert_to<int>(); 1353 1353 } … … 1360 1360 inline int iround(const number<T, ExpressionTemplates>& v, const Policy& pol) 1361 1361 { 1362 1362 number<T, ExpressionTemplates> r = round(v, pol); 1363 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || ! boost::math::isfinite(v))1363 if((r > (std::numeric_limits<int>::max)()) || r < (std::numeric_limits<int>::min)() || !(boost::math::isfinite)(v)) 1364 1364 return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0, pol); 1365 1365 return r.template convert_to<int>(); 1366 1366 } … … 1374 1374 { 1375 1375 typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type; 1376 1376 number_type r = round(v, pol); 1377 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || ! boost::math::isfinite(v))1377 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v)) 1378 1378 return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, number_type(v), 0L, pol); 1379 1379 return r.template convert_to<long>(); 1380 1380 } … … 1387 1387 inline long lround(const number<T, ExpressionTemplates>& v, const Policy& pol) 1388 1388 { 1389 1389 number<T, ExpressionTemplates> r = round(v, pol); 1390 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || ! boost::math::isfinite(v))1390 if((r > (std::numeric_limits<long>::max)()) || r < (std::numeric_limits<long>::min)() || !(boost::math::isfinite)(v)) 1391 1391 return boost::math::policies::raise_rounding_error("boost::multiprecision::lround<%1%>(%1%)", 0, v, 0L, pol); 1392 1392 return r.template convert_to<long>(); 1393 1393 } … … 1402 1402 { 1403 1403 typedef typename detail::expression<tag, A1, A2, A3, A4>::result_type number_type; 1404 1404 number_type r = round(v, pol); 1405 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || ! boost::math::isfinite(v))1405 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v)) 1406 1406 return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, number_type(v), 0LL, pol); 1407 1407 return r.template convert_to<long long>(); 1408 1408 } … … 1415 1415 inline long long llround(const number<T, ExpressionTemplates>& v, const Policy& pol) 1416 1416 { 1417 1417 number<T, ExpressionTemplates> r = round(v, pol); 1418 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || ! boost::math::isfinite(v))1418 if((r > (std::numeric_limits<long long>::max)()) || r < (std::numeric_limits<long long>::min)() || !(boost::math::isfinite)(v)) 1419 1419 return boost::math::policies::raise_rounding_error("boost::multiprecision::iround<%1%>(%1%)", 0, v, 0LL, pol); 1420 1420 return r.template convert_to<long long>(); 1421 1421 } -
boost/multiprecision/cpp_dec_float.hpp
440 440 } 441 441 442 442 // Comparison functions 443 bool isnan (void) const { return (fpclass == cpp_dec_float_NaN); }444 bool isinf (void) const { return (fpclass == cpp_dec_float_inf); }445 bool isfinite (void) const { return (fpclass == cpp_dec_float_finite); }443 bool isnan BOOST_NO_MACRO_EXPAND(void) const { return (fpclass == cpp_dec_float_NaN); } 444 bool isinf BOOST_NO_MACRO_EXPAND(void) const { return (fpclass == cpp_dec_float_inf); } 445 bool isfinite BOOST_NO_MACRO_EXPAND(void) const { return (fpclass == cpp_dec_float_finite); } 446 446 447 447 bool iszero (void) const 448 448 { … … 505 505 static cpp_dec_float pow2(long long i); 506 506 ExponentType order()const 507 507 { 508 const bool bo_order_is_zero = ((! isfinite()) || (data[0] == static_cast<boost::uint32_t>(0u)));508 const bool bo_order_is_zero = ((!(isfinite)()) || (data[0] == static_cast<boost::uint32_t>(0u))); 509 509 // 510 510 // Binary search to find the order of the leading term: 511 511 // … … 609 609 template <unsigned Digits10, class ExponentType, class Allocator> 610 610 cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator+=(const cpp_dec_float<Digits10, ExponentType, Allocator>& v) 611 611 { 612 if( isnan())612 if((isnan)()) 613 613 { 614 614 return *this; 615 615 } 616 616 617 if( isinf())617 if((isinf)()) 618 618 { 619 if( v.isinf() && (isneg() != v.isneg()))619 if((v.isinf)() && (isneg() != v.isneg())) 620 620 { 621 621 *this = nan(); 622 622 } … … 846 846 neg = false; 847 847 848 848 // Handle special cases like zero, inf and NaN. 849 const bool b_u_is_inf = isinf();850 const bool b_v_is_inf = v.isinf();849 const bool b_u_is_inf = (isinf)(); 850 const bool b_v_is_inf = (v.isinf)(); 851 851 const bool b_u_is_zero = iszero(); 852 852 const bool b_v_is_zero = v.iszero(); 853 853 854 if( ( isnan() || v.isnan())854 if( ((isnan)() || (v.isnan)()) 855 855 || (b_u_is_inf && b_v_is_zero) 856 856 || (b_v_is_inf && b_u_is_zero) 857 857 ) … … 932 932 template <unsigned Digits10, class ExponentType, class Allocator> 933 933 cpp_dec_float<Digits10, ExponentType, Allocator>& cpp_dec_float<Digits10, ExponentType, Allocator>::operator/=(const cpp_dec_float<Digits10, ExponentType, Allocator>& v) 934 934 { 935 const bool u_and_v_are_finite_and_identical = ( isfinite()935 const bool u_and_v_are_finite_and_identical = ( (isfinite)() 936 936 && (fpclass == v.fpclass) 937 937 && (exp == v.exp) 938 938 && (cmp_data(v.data) == static_cast<boost::int32_t>(0))); … … 952 952 { 953 953 if(iszero()) 954 954 { 955 if( v.isnan() || v.iszero())955 if((v.isnan)() || v.iszero()) 956 956 { 957 957 return *this = v; 958 958 } … … 976 976 neg = false; 977 977 978 978 // Handle special cases like zero, inf and NaN. 979 const bool b_u_is_inf = isinf();979 const bool b_u_is_inf = (isinf)(); 980 980 const bool b_n_is_zero = (n == static_cast<boost::int32_t>(0)); 981 981 982 if( isnan() || (b_u_is_inf && b_n_is_zero))982 if((isnan)() || (b_u_is_inf && b_n_is_zero)) 983 983 { 984 984 return (*this = nan()); 985 985 } … … 1071 1071 neg = false; 1072 1072 1073 1073 // Handle special cases like zero, inf and NaN. 1074 if( isnan())1074 if((isnan)()) 1075 1075 { 1076 1076 return *this; 1077 1077 } 1078 1078 1079 if( isinf())1079 if((isinf)()) 1080 1080 { 1081 1081 *this = inf(); 1082 1082 if(b_neg) … … 1165 1165 return *this; 1166 1166 } 1167 1167 1168 if( isnan())1168 if((isnan)()) 1169 1169 { 1170 1170 return *this; 1171 1171 } 1172 1172 1173 if( isinf())1173 if((isinf)()) 1174 1174 { 1175 1175 return *this = zero(); 1176 1176 } … … 1227 1227 { 1228 1228 // Compute the square root of *this. 1229 1229 1230 if(isneg() || (! isfinite()))1230 if(isneg() || (!(isfinite)())) 1231 1231 { 1232 1232 *this = nan(); 1233 1233 return *this; … … 1336 1336 // -1 for *this < v 1337 1337 1338 1338 // Handle all non-finite cases. 1339 if((! isfinite()) || (!v.isfinite()))1339 if((!(isfinite)()) || (!(v.isfinite)())) 1340 1340 { 1341 1341 // NaN can never equal NaN. Return an implementation-dependent 1342 1342 // signed result. Also note that comparison of NaN with NaN 1343 1343 // using operators greater-than or less-than is undefined. 1344 if( isnan() || v.isnan()) { return (isnan() ? 1 : -1); }1344 if((isnan)() || (v.isnan)()) { return ((isnan)() ? 1 : -1); } 1345 1345 1346 if( isinf() && v.isinf())1346 if((isinf)() && (v.isinf)()) 1347 1347 { 1348 1348 // Both *this and v are infinite. They are equal if they have the same sign. 1349 1349 // Otherwise, *this is less than v if and only if *this is negative. 1350 1350 return ((neg == v.neg) ? 0 : (neg ? -1 : 1)); 1351 1351 } 1352 1352 1353 if( isinf())1353 if((isinf)()) 1354 1354 { 1355 1355 // *this is infinite, but v is finite. 1356 1356 // So negative infinite *this is less than any finite v. … … 1410 1410 { 1411 1411 // Check if the value of *this is identically 1 or very close to 1. 1412 1412 1413 const bool not_negative_and_is_finite = ((!neg) && isfinite());1413 const bool not_negative_and_is_finite = ((!neg) && (isfinite)()); 1414 1414 1415 1415 if(not_negative_and_is_finite) 1416 1416 { … … 1506 1506 // Returns the double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>. 1507 1507 1508 1508 // Check for non-normal cpp_dec_float<Digits10, ExponentType, Allocator>. 1509 if(! isfinite())1509 if(!(isfinite)()) 1510 1510 { 1511 if( isnan())1511 if((isnan)()) 1512 1512 { 1513 1513 return std::numeric_limits<double>::quiet_NaN(); 1514 1514 } … … 1552 1552 // Returns the long double conversion of a cpp_dec_float<Digits10, ExponentType, Allocator>. 1553 1553 1554 1554 // Check if *this cpp_dec_float<Digits10, ExponentType, Allocator> is subnormal. 1555 if(! isfinite())1555 if(!(isfinite)()) 1556 1556 { 1557 if( isnan())1557 if((isnan)()) 1558 1558 { 1559 1559 return std::numeric_limits<long double>::quiet_NaN(); 1560 1560 } … … 1686 1686 { 1687 1687 // Compute the signed integer part of x. 1688 1688 1689 if(! isfinite())1689 if(!(isfinite)()) 1690 1690 { 1691 1691 return *this; 1692 1692 } … … 1716 1716 template <unsigned Digits10, class ExponentType, class Allocator> 1717 1717 std::string cpp_dec_float<Digits10, ExponentType, Allocator>::str(boost::intmax_t number_of_digits, std::ios_base::fmtflags f) const 1718 1718 { 1719 if( this->isinf())1719 if((this->isinf)()) 1720 1720 { 1721 1721 if(this->isneg()) 1722 1722 return "-inf"; … … 1725 1725 else 1726 1726 return "inf"; 1727 1727 } 1728 else if( this->isnan())1728 else if((this->isnan)()) 1729 1729 { 1730 1730 return "nan"; 1731 1731 } … … 2722 2722 template <unsigned Digits10, class ExponentType, class Allocator> 2723 2723 inline int eval_fpclassify(const cpp_dec_float<Digits10, ExponentType, Allocator>& x) 2724 2724 { 2725 if( x.isinf())2725 if((x.isinf)()) 2726 2726 return FP_INFINITE; 2727 if( x.isnan())2727 if((x.isnan)()) 2728 2728 return FP_NAN; 2729 2729 if(x.iszero()) 2730 2730 return FP_ZERO; … … 2758 2758 inline void eval_floor(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) 2759 2759 { 2760 2760 result = x; 2761 if(! x.isfinite() || x.isint())2761 if(!(x.isfinite)() || x.isint()) 2762 2762 { 2763 2763 return; 2764 2764 } … … 2772 2772 inline void eval_ceil(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) 2773 2773 { 2774 2774 result = x; 2775 if(! x.isfinite() || x.isint())2775 if(!(x.isfinite)() || x.isint()) 2776 2776 { 2777 2777 return; 2778 2778 } … … 2785 2785 template <unsigned Digits10, class ExponentType, class Allocator> 2786 2786 inline void eval_trunc(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x) 2787 2787 { 2788 if(! x.isfinite())2788 if(!(x.isfinite)()) 2789 2789 { 2790 2790 result = boost::math::policies::raise_rounding_error("boost::multiprecision::trunc<%1%>(%1%)", 0, number<cpp_dec_float<Digits10, ExponentType, Allocator> >(x), number<cpp_dec_float<Digits10, ExponentType, Allocator> >(x), boost::math::policies::policy<>()).backend(); 2791 2791 return; … … 2844 2844 2845 2845 result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t); 2846 2846 2847 if(result.iszero() || result.isinf() || result.isnan())2847 if(result.iszero() || (result.isinf)() || (result.isnan)()) 2848 2848 { 2849 2849 // pow2 overflowed, slip the calculation up: 2850 2850 result = x; -
libs/math/test/test_students_t.cpp
634 634 if(std::numeric_limits<RealType>::has_quiet_NaN) 635 635 { 636 636 // Mean 637 BOOST_CHECK( boost::math::isnan(mean(ignore_error_students_t(-1))));638 BOOST_CHECK( boost::math::isnan(mean(ignore_error_students_t(0))));639 BOOST_CHECK( boost::math::isnan(mean(ignore_error_students_t(1))));637 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(-1)))); 638 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(0)))); 639 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_students_t(1)))); 640 640 641 641 // Variance 642 BOOST_CHECK( boost::math::isnan(variance(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));643 BOOST_CHECK( boost::math::isnan(variance(ignore_error_students_t(-1))));644 BOOST_CHECK( boost::math::isnan(variance(ignore_error_students_t(0))));645 BOOST_CHECK( boost::math::isnan(variance(ignore_error_students_t(1))));646 BOOST_CHECK( boost::math::isnan(variance(ignore_error_students_t(static_cast<RealType>(1.7L)))));647 BOOST_CHECK( boost::math::isnan(variance(ignore_error_students_t(2))));642 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN())))); 643 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(-1)))); 644 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(0)))); 645 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(1)))); 646 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(static_cast<RealType>(1.7L))))); 647 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_students_t(2)))); 648 648 649 649 // Skewness 650 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));651 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_students_t(-1))));652 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_students_t(0))));653 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_students_t(1))));654 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_students_t(2))));655 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_students_t(3))));650 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN())))); 651 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(-1)))); 652 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(0)))); 653 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(1)))); 654 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(2)))); 655 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_students_t(3)))); 656 656 657 657 // Kurtosis 658 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));659 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(-1))));660 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(0))));661 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(1))));662 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(2))));663 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(static_cast<RealType>(2.0001L)))));664 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(3))));665 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_students_t(4))));658 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN())))); 659 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(-1)))); 660 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(0)))); 661 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(1)))); 662 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(2)))); 663 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(static_cast<RealType>(2.0001L))))); 664 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(3)))); 665 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_students_t(4)))); 666 666 667 667 // Kurtosis excess 668 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN()))));669 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(-1))));670 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(0))));671 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(1))));672 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(2))));673 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(static_cast<RealType>(2.0001L)))));674 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(3))));675 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_students_t(4))));668 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(std::numeric_limits<RealType>::quiet_NaN())))); 669 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(-1)))); 670 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(0)))); 671 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(1)))); 672 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(2)))); 673 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(static_cast<RealType>(2.0001L))))); 674 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(3)))); 675 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_students_t(4)))); 676 676 } // has_quiet_NaN 677 677 678 BOOST_CHECK( boost::math::isfinite(mean(ignore_error_students_t(1 + std::numeric_limits<RealType>::epsilon()))));679 BOOST_CHECK( boost::math::isfinite(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon()))));680 BOOST_CHECK( boost::math::isfinite(variance(ignore_error_students_t(static_cast<RealType>(2.0001L)))));681 BOOST_CHECK( boost::math::isfinite(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon()))));682 BOOST_CHECK( boost::math::isfinite(skewness(ignore_error_students_t(3 + 3 * std::numeric_limits<RealType>::epsilon()))));683 BOOST_CHECK( boost::math::isfinite(kurtosis(ignore_error_students_t(4 + 4 * std::numeric_limits<RealType>::epsilon()))));684 BOOST_CHECK( boost::math::isfinite(kurtosis(ignore_error_students_t(static_cast<RealType>(4.0001L)))));678 BOOST_CHECK((boost::math::isfinite)(mean(ignore_error_students_t(1 + std::numeric_limits<RealType>::epsilon())))); 679 BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon())))); 680 BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_students_t(static_cast<RealType>(2.0001L))))); 681 BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_students_t(2 + 2 * std::numeric_limits<RealType>::epsilon())))); 682 BOOST_CHECK((boost::math::isfinite)(skewness(ignore_error_students_t(3 + 3 * std::numeric_limits<RealType>::epsilon())))); 683 BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_students_t(4 + 4 * std::numeric_limits<RealType>::epsilon())))); 684 BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_students_t(static_cast<RealType>(4.0001L))))); 685 685 686 686 // check_out_of_range<students_t_distribution<RealType> >(1); 687 687 // Cannot be used because fails "exception std::domain_error is expected" -
libs/math/test/test_airy.cpp
49 49 for(unsigned i = 0; i < data.size(); ++i) 50 50 { 51 51 BOOST_CHECK_CLOSE_FRACTION(data[i][1], boost::math::airy_ai(data[i][0]), tol); 52 if( boost::math::isfinite(data[i][2]))52 if((boost::math::isfinite)(data[i][2])) 53 53 BOOST_CHECK_CLOSE_FRACTION(data[i][2], boost::math::airy_bi(data[i][0]), tol); 54 54 BOOST_CHECK_CLOSE_FRACTION(data[i][3], boost::math::airy_ai_prime(data[i][0]), tol); 55 if( boost::math::isfinite(data[i][4]))55 if((boost::math::isfinite)(data[i][4])) 56 56 BOOST_CHECK_CLOSE_FRACTION(data[i][4], boost::math::airy_bi_prime(data[i][0]), tol); 57 57 } 58 58 } -
libs/math/test/test_nc_t.cpp
737 737 if(std::numeric_limits<RealType>::has_quiet_NaN) 738 738 { 739 739 // Mean 740 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(-nan, 0))));741 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(+nan, 0))));742 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(-1, 0))));743 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(0, 0))));744 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(1, 0))));745 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(2, nan))));746 BOOST_CHECK( boost::math::isnan(mean(ignore_error_non_central_t(nan, nan))));747 BOOST_CHECK( boost::math::isfinite(mean(ignore_error_non_central_t(2, 0)))); // OK740 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(-nan, 0)))); 741 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(+nan, 0)))); 742 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(-1, 0)))); 743 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(0, 0)))); 744 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(1, 0)))); 745 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(2, nan)))); 746 BOOST_CHECK((boost::math::isnan)(mean(ignore_error_non_central_t(nan, nan)))); 747 BOOST_CHECK((boost::math::isfinite)(mean(ignore_error_non_central_t(2, 0)))); // OK 748 748 749 749 // Variance 750 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(nan, 0))));751 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(1, nan))));752 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(2, nan))));753 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(-1, 0))));754 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(0, 0))));755 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(1, 0))));756 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(static_cast<RealType>(1.7L), 0))));757 BOOST_CHECK( boost::math::isnan(variance(ignore_error_non_central_t(2, 0))));750 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(nan, 0)))); 751 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(1, nan)))); 752 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(2, nan)))); 753 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(-1, 0)))); 754 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(0, 0)))); 755 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(1, 0)))); 756 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(static_cast<RealType>(1.7L), 0)))); 757 BOOST_CHECK((boost::math::isnan)(variance(ignore_error_non_central_t(2, 0)))); 758 758 759 759 // Skewness 760 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));761 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_non_central_t(-1, 0))));762 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_non_central_t(0, 0))));763 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_non_central_t(1, 0))));764 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_non_central_t(2, 0))));765 BOOST_CHECK( boost::math::isnan(skewness(ignore_error_non_central_t(3, 0))));760 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0)))); 761 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(-1, 0)))); 762 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(0, 0)))); 763 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(1, 0)))); 764 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(2, 0)))); 765 BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_non_central_t(3, 0)))); 766 766 767 767 // Kurtosis 768 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));769 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(-1, 0))));770 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(0, 0))));771 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(1, 0))));772 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(2, 0))));773 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));774 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(3, 0))));775 BOOST_CHECK( boost::math::isnan(kurtosis(ignore_error_non_central_t(4, 0))));768 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0)))); 769 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(-1, 0)))); 770 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(0, 0)))); 771 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(1, 0)))); 772 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(2, 0)))); 773 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0)))); 774 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(3, 0)))); 775 BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_non_central_t(4, 0)))); 776 776 777 777 // Kurtosis excess 778 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0))));779 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(-1, 0))));780 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(0, 0))));781 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(1, 0))));782 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(2, 0))));783 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));784 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(3, 0))));785 BOOST_CHECK( boost::math::isnan(kurtosis_excess(ignore_error_non_central_t(4, 0))));778 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(std::numeric_limits<RealType>::quiet_NaN(), 0)))); 779 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(-1, 0)))); 780 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(0, 0)))); 781 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(1, 0)))); 782 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(2, 0)))); 783 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0)))); 784 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(3, 0)))); 785 BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_non_central_t(4, 0)))); 786 786 } // has_quiet_NaN 787 787 788 BOOST_CHECK( boost::math::isfinite(mean(ignore_error_non_central_t(1 + std::numeric_limits<RealType>::epsilon(), 0))));789 BOOST_CHECK( boost::math::isfinite(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));790 BOOST_CHECK( boost::math::isfinite(variance(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0))));791 BOOST_CHECK( boost::math::isfinite(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0))));792 BOOST_CHECK( boost::math::isfinite(skewness(ignore_error_non_central_t(3 + 3 * std::numeric_limits<RealType>::epsilon(), 0))));793 BOOST_CHECK( boost::math::isfinite(kurtosis(ignore_error_non_central_t(4 + 4 * std::numeric_limits<RealType>::epsilon(), 0))));794 BOOST_CHECK( boost::math::isfinite(kurtosis(ignore_error_non_central_t(static_cast<RealType>(4.0001L), 0))));788 BOOST_CHECK((boost::math::isfinite)(mean(ignore_error_non_central_t(1 + std::numeric_limits<RealType>::epsilon(), 0)))); 789 BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0)))); 790 BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_non_central_t(static_cast<RealType>(2.0001L), 0)))); 791 BOOST_CHECK((boost::math::isfinite)(variance(ignore_error_non_central_t(2 + 2 * std::numeric_limits<RealType>::epsilon(), 0)))); 792 BOOST_CHECK((boost::math::isfinite)(skewness(ignore_error_non_central_t(3 + 3 * std::numeric_limits<RealType>::epsilon(), 0)))); 793 BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_non_central_t(4 + 4 * std::numeric_limits<RealType>::epsilon(), 0)))); 794 BOOST_CHECK((boost::math::isfinite)(kurtosis(ignore_error_non_central_t(static_cast<RealType>(4.0001L), 0)))); 795 795 796 796 // check_out_of_range<non_central_t_distribution<RealType> >(1, 0); // Fails one check because allows df = infinity. 797 797 check_support<non_central_t_distribution<RealType> >(non_central_t_distribution<RealType>(1, 0)); -
libs/math/test/complex_test.cpp
406 406 BOOST_CHECK((boost::math::isnan)(result.real())); 407 407 BOOST_CHECK(result.imag() == infinity); 408 408 } 409 if( boost::math::signbit(mzero))409 if((boost::math::signbit)(mzero)) 410 410 { 411 411 result = boost::math::acos(ct(-1.25f, zero)); 412 412 BOOST_CHECK(result.real() > 0); … … 537 537 BOOST_CHECK((boost::math::isnan)(result.real())); 538 538 BOOST_CHECK((boost::math::isnan)(result.imag())); 539 539 } 540 if( boost::math::signbit(mzero))540 if((boost::math::signbit)(mzero)) 541 541 { 542 542 result = boost::math::acosh(ct(-2.5f, zero)); 543 543 BOOST_CHECK(result.real() > 0); … … 669 669 BOOST_CHECK(std::fabs(result.real()) == infinity); 670 670 BOOST_CHECK((boost::math::isnan)(result.imag())); 671 671 } 672 if( boost::math::signbit(mzero))672 if((boost::math::signbit)(mzero)) 673 673 { 674 674 result = boost::math::asinh(ct(zero, 1.5f)); 675 675 BOOST_CHECK(result.real() > 0); … … 817 817 BOOST_CHECK((boost::math::isnan)(result.imag())); 818 818 819 819 } 820 if( boost::math::signbit(mzero))820 if((boost::math::signbit)(mzero)) 821 821 { 822 822 result = boost::math::atanh(ct(-2.0f, mzero)); 823 823 BOOST_CHECK(result.real() < 0); -
libs/multiprecision/test/test_arithmetic.hpp
813 813 { 814 814 if(std::numeric_limits<Real>::has_infinity) 815 815 { 816 BOOST_CHECK( boost::math::isinf(Real(20) / 0u));816 BOOST_CHECK((boost::math::isinf)(Real(20) / 0u)); 817 817 } 818 818 else 819 819 { -
libs/multiprecision/test/test_numeric_limits.cpp
72 72 Number minv, maxv; 73 73 minv = (std::numeric_limits<Number>::min)(); 74 74 maxv = (std::numeric_limits<Number>::max)(); 75 BOOST_CHECK( boost::math::isnormal(minv));76 BOOST_CHECK( boost::math::isnormal(maxv));77 BOOST_CHECK( boost::math::isnormal(log(minv)));78 BOOST_CHECK( boost::math::isnormal(log(maxv)));79 BOOST_CHECK( boost::math::isnormal(sqrt(minv)));80 BOOST_CHECK( boost::math::isnormal(sqrt(maxv)));75 BOOST_CHECK((boost::math::isnormal)(minv)); 76 BOOST_CHECK((boost::math::isnormal)(maxv)); 77 BOOST_CHECK((boost::math::isnormal)(log(minv))); 78 BOOST_CHECK((boost::math::isnormal)(log(maxv))); 79 BOOST_CHECK((boost::math::isnormal)(sqrt(minv))); 80 BOOST_CHECK((boost::math::isnormal)(sqrt(maxv))); 81 81 82 82 if(std::numeric_limits<Number>::is_specialized) 83 83 { -
libs/multiprecision/test/test_float_io.cpp
201 201 T val = std::numeric_limits<T>::quiet_NaN(); 202 202 BOOST_CHECK_EQUAL(val.str(), "nan"); 203 203 val = static_cast<T>("nan"); 204 BOOST_CHECK( boost::math::isnan(val));204 BOOST_CHECK((boost::math::isnan)(val)); 205 205 } 206 206 } 207 207