]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/multiprecision/test/test_sqrt.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / multiprecision / test / test_sqrt.cpp
index 232fc3aca46fc496e56291358d67a9de7484a77f..7588c263ff8ad07814a408e54bc3265747e90044 100644 (file)
@@ -2,14 +2,14 @@
 //  Copyright Christopher Kormanyos 2002 - 2011.
 //  Copyright 2011 John Maddock. Distributed under the Boost
 //  Software License, Version 1.0. (See accompanying file
-//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
+//  LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
 //
 // This work is based on an earlier work:
 // "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
 // in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
 
 #ifdef _MSC_VER
-#  define _SCL_SECURE_NO_WARNINGS
+#define _SCL_SECURE_NO_WARNINGS
 #endif
 
 #include <boost/detail/lightweight_test.hpp>
 #include "test.hpp"
 
 #if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPFI_50) && !defined(TEST_FLOAT128) && !defined(TEST_CPP_BIN_FLOAT)
-#  define TEST_MPF_50
-#  define TEST_MPFR_50
-#  define TEST_MPFI_50
-#  define TEST_BACKEND
-#  define TEST_CPP_DEC_FLOAT
-#  define TEST_FLOAT128
-#  define TEST_CPP_BIN_FLOAT
+#define TEST_MPF_50
+#define TEST_MPFR_50
+#define TEST_MPFI_50
+#define TEST_BACKEND
+#define TEST_CPP_DEC_FLOAT
+#define TEST_FLOAT128
+#define TEST_CPP_BIN_FLOAT
 
 #ifdef _MSC_VER
 #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
@@ -60,7 +60,7 @@ template <class T>
 void test()
 {
    static const boost::array<const char*, 101u> data =
-   {{
+       {{
            "0",
            "1.77245385090551602729816748334114518279754945612238712821380778985291128459103218137495065673854466541622682362428257066623615286572442260252509370960278706846203769865310512284992517302895082622893209537926796280017463901535147972051670019018523401858544697449491264031392177552590621640541933250090639840761373347747515343366798978936585183640879545116516173876005906739343179133280985484624818490205465485219561325156164746751504273876105610799612710721006037204448367236529661370809432349883166842421384570960912042042778577806869476657000521830568512541339663694465418151071669388332194292935706226886522442054214994804992075648639887483850593064021821402928581123306497894520362114907896228738940324597819851313487126651250629326004465638210967502681249693059542046156076195221739152507020779275809905433290066222306761446966124818874306997883520506146444385418530797357425717918563595974995995226384924220388910396640644729397284134504300214056423343303926175613417633632001703765416347632066927654181283576249032690450848532013419243598973087119379948293873011126256165881888478597787596376136",
            "2.50662827463100050241576528481104525300698674060993831662992357634229365460784197494659583837805726611600997266520387964486632361812673618095785565596614793191343548045812373113732780431301993880264715023446550489842580232941386277966868361303367582384418115607849009560004137515027529165146122584386186492069906092666409118801573969725237770253874824784863348864259750658951309573876342725192688040202857185924973630809978452538550099964101929825864558813716963467480152897452330473583474775619896089188931497718648548480469365216002979523919601823809165790411297975297712884880166754700558630196824142164233836361751921305615135984170982837036342343558097687424487526178010922324284883919536725153974582825630336511862808790203551930088145604026487771415650048376723275094136806424717481635184471307383168191953698843723340165605500555063029823385865249561125896634362311039438867484401970215424844692673432572876116452243380115662703163531763018031226825617668891776095502388960424467990521700581770868994182958846287294933254842394882655811767896697230383860684402997328870793925904767307522570843",
@@ -162,17 +162,17 @@ void test()
            "17.5463979224170035169103569936773167710489071842695682164094650343960555822548938246261708686464008628120698086564271575140642653268871532667049895917630355233940483632068661179612946301911395716185300516412585342889806163058970394576807852912357307669092680925494306692002896260519270415602285809070330544448934264866486383161101778807666439177712377349404344204981825461265916701713439907634881628142000030147481541566984916776985069974871350878105191169601874427236107028216631331508432342933927262432252048403053983936328555651202085666743721276666416053287908582708399019416116728290391041137776899514963685453226344913930595188919687985925439640490668381197141268324607645626999418743675707607782207977941235558303966153142486351061701922818541439990955033863706292565895764497302237144629129915168217734367589190606338115923850388544120876370105674692788127644053617727607207239081379150797391284871402801013281516570366080963892214472234112621858777932368224243266851672272297127593365190407239608295928071192401106453278389676417859068237527688061268702479082098130209555748133337115265799590",
            "17.6356931450223847051632626336912129159953047631160231255194263214719736745345056574006334052947783704789851124650942357806440283438448075865374177648755421744889004812088237415174002112721888433569481184443980026560025069439822330036408245659699705607208167409459718244781459151859701286920686791397587316924683661006361446569736280386659169943463243969853737516308403647389899899943288964539074045777396061094245615020794569618969810767286161759163196190210263374998456288778623199988233761901113536316735857956970778148341712538680960137046414511920334125306354736321418705129785669231702905296255118678564162795574424588337165553826200448066730531304621451838136219021244379504974116096097930348202146495020513154705219076501726427281405053157307369058563911985328395372478199002802154489559015174957595775902617263259894306671438880488104887489699278033942889387921168112741333336787578922278486757542524555357598873580646861232908497366240101359399679018683387336026768844320636768908505456317105807294092097672788610628498171867123780698747648210099920520967511623044818811130645542567309932834",
            "17.7245385090551602729816748334114518279754945612238712821380778985291128459103218137495065673854466541622682362428257066623615286572442260252509370960278706846203769865310512284992517302895082622893209537926796280017463901535147972051670019018523401858544697449491264031392177552590621640541933250090639840761373347747515343366798978936585183640879545116516173876005906739343179133280985484624818490205465485219561325156164746751504273876105610799612710721006037204448367236529661370809432349883166842421384570960912042042778577806869476657000521830568512541339663694465418151071669388332194292935706226886522442054214994804992075648639887483850593064021821402928581123306497894520362114907896228738940324597819851313487126651250629326004465638210967502681249693059542046156076195221739152507020779275809905433290066222306761446966124818874306997883520506146444385418530797357425717918563595974995995226384924220388910396640644729397284134504300214056423343303926175613417633632001703765416347632066927654181283576249032690450848532013419243598973087119379948293873011126256165881888478597787596376136",
-   }};
+       }};
 
    T pi = static_cast<T>("3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019893809525720106548586327886593615338182796823030195203530185296899577362259941389124972177528347913152");
 
    unsigned max_err = 0;
-   for(unsigned k = 0; k < data.size(); k++)
+   for (unsigned k = 0; k < data.size(); k++)
    {
-      T val = sqrt(pi * k);
-      T e = relative_error(val, T(data[k]));
+      T        val = sqrt(pi * k);
+      T        e   = relative_error(val, T(data[k]));
       unsigned err = e.template convert_to<unsigned>();
-      if(err > max_err)
+      if (err > max_err)
       {
          max_err = err;
       }
@@ -190,7 +190,6 @@ void test()
    BOOST_CHECK((boost::math::isfinite)(sqrt((std::numeric_limits<T>::min)())));
 }
 
-
 int main()
 {
 #ifdef TEST_BACKEND
@@ -238,6 +237,3 @@ int main()
 #endif
    return boost::report_errors();
 }
-
-
-