2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Fix for unable to find numeric literal operator Q

This commit is contained in:
Matt Borland
2021-02-03 20:14:25 +03:00
parent 91ae2bfc77
commit 86d2843fa4

View File

@@ -304,6 +304,8 @@ namespace test_cstdfloat
}
s = 8 * std::numeric_limits<T>::epsilon();
val = 2.5;
#ifndef __STRICT_ANSI__
BOOST_CHECK_CLOSE_FRACTION(std::asinh(val), T(1.6472311463710957106248586104436196635044144301932365282203100930843983757633104078778420255069424907777006132075516484778755360595913172299093829522950397895699619540523579875476513967578478619028438291006578604823887119907434Q), s);
BOOST_CHECK_CLOSE_FRACTION(std::acosh(val), T(1.5667992369724110786640568625804834938620823510926588639329459980122148134693922696279968499622201141051039184050936311066453565386393240356562374302417843319480223211857615778787272615171906055455922537080327062362258846337050Q), s);
val = 0.5;
@@ -315,6 +317,7 @@ namespace test_cstdfloat
BOOST_CHECK_CLOSE_FRACTION(std::erfc(val), T(0.0001006219221196368369043919750869567650647378577359344838904205345473577974091038552671703318943107024785655220699265379744608317286480734951503800965036293023579017150401810928534333133630603234998927812461267199856054467512Q), s);
val = 0.125;
BOOST_CHECK_CLOSE_FRACTION(std::expm1(val), T(0.1331484530668263168290072278117938725655031317451816259128200360788235778800483865139399907949417285732315270156473075657048210452584733998785564025916995261162759280700397984729320345630340659469435372721057879969170503978449Q), s);
#endif
val = 20;
s = 2;
@@ -396,6 +399,8 @@ namespace test_cstdfloat
T tol = 8 * std::numeric_limits<T>::epsilon();
s = 2;
#ifndef __STRICT_ANSI__
BOOST_CHECK_CLOSE_FRACTION(T(std::hypot(val, s)), T(20.099751242241780540438529825519152373890046940052754581145656594656982463103940762472355384907904704732599006530Q), tol);
BOOST_CHECK_CLOSE_FRACTION(T(std::hypot(val, 2)), T(20.099751242241780540438529825519152373890046940052754581145656594656982463103940762472355384907904704732599006530Q), tol);
BOOST_CHECK_CLOSE_FRACTION(T(std::hypot(val, 2.0)), T(20.099751242241780540438529825519152373890046940052754581145656594656982463103940762472355384907904704732599006530Q), tol);
@@ -410,18 +415,21 @@ namespace test_cstdfloat
BOOST_CHECK_CLOSE_FRACTION(std::lgamma(val), T(39.339884187199494036224652394567381081691457206897853119937969989377572554993874476249340525204204720861169039582Q), tol);
BOOST_CHECK_CLOSE_FRACTION(std::lgamma(val + 0), T(39.339884187199494036224652394567381081691457206897853119937969989377572554993874476249340525204204720861169039582Q), tol);
#endif
BOOST_CHECK_EQUAL(std::lrint(val), 20);
BOOST_CHECK_EQUAL(std::lrint(val * 2), 40);
BOOST_CHECK_EQUAL(std::llrint(val), 20);
BOOST_CHECK_EQUAL(std::llrint(val * 2), 40);
#ifndef __STRICT_ANSI__
val = 0.125;
BOOST_CHECK_CLOSE_FRACTION(std::log1p(val), T(0.117783035656383454538794109470521705068480712564733141107348638794807720528133786929641528638208114949935615070Q), tol);
BOOST_CHECK_CLOSE_FRACTION(std::log1p(val + 0), T(0.117783035656383454538794109470521705068480712564733141107348638794807720528133786929641528638208114949935615070Q), tol);
val = 20;
BOOST_CHECK_CLOSE_FRACTION(T(std::log2(val)), T(4.321928094887362347870319429489390175864831393024580612054756395815934776608625215850139743359370155099657371710Q), tol);
BOOST_CHECK_CLOSE_FRACTION(T(std::log2(val + 0)), T(4.321928094887362347870319429489390175864831393024580612054756395815934776608625215850139743359370155099657371710Q), tol);
#endif
BOOST_CHECK_EQUAL(T(std::nearbyint(val)), 20);
BOOST_CHECK_EQUAL(T(std::nearbyint(val + 0.25)), 20);
@@ -475,11 +483,15 @@ namespace test_cstdfloat
i = 0;
val = 5.25;
tol = 3000;
#ifndef __STRICT_ANSI__
BOOST_CHECK_CLOSE_FRACTION(std::tgamma(val), T(35.211611852799685705225257690531248115026311138908448314086859575901217653313145619623624570033258659272301335544Q), tol);
BOOST_CHECK_CLOSE_FRACTION(std::tgamma(val + 1), T(184.86096222719834995243260287528905260388813347926935364895601277348139267989401450302402899267460796117958201160Q), tol);
BOOST_CHECK_CLOSE_FRACTION(T(std::exp2(val)), T(38.054627680087074134959999057935229289375106958842157216608071191022933383261349115865003025220405558913196632792Q), tol);
BOOST_CHECK_CLOSE_FRACTION(T(std::exp2(val + 1)), T(76.109255360174148269919998115870458578750213917684314433216142382045866766522698231730006050440811117826393265585Q), tol);
#endif
val = 15;
BOOST_CHECK_CLOSE_FRACTION(T(std::exp2(val)), T(32768uL), tol);
BOOST_CHECK_CLOSE_FRACTION(T(std::exp2(val + 1)), T(65536uL), tol);