Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
7101911d
Commit
7101911d
authored
Jun 16, 2018
by
abolz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run all the new tests in full-precision mode only
until I know what the normal-precision algorithm really does...
parent
319944a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
152 additions
and
159 deletions
+152
-159
readertest.cpp
test/unittest/readertest.cpp
+152
-159
No files found.
test/unittest/readertest.cpp
View file @
7101911d
...
...
@@ -392,15 +392,6 @@ static void TestParseDouble() {
"83723677529752585477247372368372368547354737253685475529752"
,
6223372036854775808.0
);
TEST_DOUBLE
(
fullPrecision
,
"1e-325"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"1e-324"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"2e-324"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"2.4703282292062327e-324"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"2.4703282292062328e-324"
,
5e-324
);
TEST_DOUBLE
(
fullPrecision
,
"2.48e-324"
,
5e-324
);
TEST_DOUBLE
(
fullPrecision
,
"2.5e-324"
,
5e-324
);
#if 0
// Test (length + exponent) overflow
TEST_DOUBLE(fullPrecision, "0e+2147483647", 0.0);
...
...
@@ -412,6 +403,14 @@ static void TestParseDouble() {
if
(
fullPrecision
)
{
TEST_DOUBLE
(
fullPrecision
,
"1e-325"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"1e-324"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"2e-324"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"2.4703282292062327e-324"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"2.4703282292062328e-324"
,
5e-324
);
TEST_DOUBLE
(
fullPrecision
,
"2.48e-324"
,
5e-324
);
TEST_DOUBLE
(
fullPrecision
,
"2.5e-324"
,
5e-324
);
// Slightly above max-normal
TEST_DOUBLE
(
fullPrecision
,
"1.7976931348623158e+308"
,
1.7976931348623158e+308
);
...
...
@@ -431,160 +430,154 @@ static void TestParseDouble() {
"828481044358810649108367633313557305310641892225870327827273"
"41408256.000000"
,
2.4354608055603473e+307
);
}
// 9007199254740991 * 2^971 (max normal)
TEST_DOUBLE
(
fullPrecision
,
"1.797693134862315708145274237317043567980705675258449965989174768031572607800285"
"38760589558632766878171540458953514382464234321326889464182768467546703537516986"
"04991057655128207624549009038932894407586850845513394230458323690322294816580855"
"9332123348274797826204144723168738177180919299881250404026184124858368e+308"
,
1.797693134862315708e+308
// 0x1.fffffffffffffp1023
);
#if 0
// TODO:
// Should work at least in full-precision mode...
TEST_DOUBLE(fullPrecision,
"0.00000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000024703282292062327208828439643411068618252"
"9901307162382212792841250337753635104375932649918180817996189"
"8982823477228588654633283551779698981993873980053909390631503"
"5659515570226392290858392449105184435931802849936536152500319"
"3704576782492193656236698636584807570015857692699037063119282"
"7955855133292783433840935197801553124659726357957462276646527"
"2827220056374006485499977096599470454020828166226237857393450"
"7363390079677619305775067401763246736009689513405355374585166"
"6113422376667860416215968046191446729184030053005753084904876"
"5391711386591646239524912623653881879636239373280423891018672"
"3484976682350898633885879256283027559956575244555072551893136"
"9083625477918694866799496832404970582102851318545139621383772"
"2826145437693412532098591327667236328125",
0.0);
#endif
// 9007199254740991 * 2^-1074 = (2^53 - 1) * 2^-1074
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402272114819593418263951869639092703291296046852219449644444042153"
"89103305904781627017582829831782607924221374017287738918929105531441481564124348"
"67599762821265346585071045737627442980259622449029037796981144446145705102663115"
"10031828794952795966823603998647925096578034214163701381261333311989876551545144"
"03152612538132666529513060001849177663286607555958373922409899478075565940981010"
"21612198814605258742579179000071675999344145086087205681577915435923018910334964"
"86942061405218289243144579760516365090360651414037721744226256159024466852576737"
"24464300755133324500796506867194913776884780053099639677097589658441378944337966"
"21993967316936280457084866613206797017728916080020698679408551343728867675409720"
"757232455434770912461317493580281734466552734375e-308"
,
4.450147717014402272e-308
// 0x1.fffffffffffffp-1022
);
// 9007199254740990 * 2^-1074
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014401778049173752171719775300846224481918930987049605124880018456471"
"39035755177760751831052846195619008686241717547743167145836439860405887584484471"
"19639655002484083577939142623582164522087943959208000909794783876158397872163051"
"22622675229968408654350206725478309956546318828765627255022767720818849892988457"
"26333908582101604036318532842699932130356061901518261174396928478121372742040102"
"17446565569357687263889031732270082446958029584739170416643195242132750803227473"
"16608838720742955671061336566907126801014814608027120593609275183716632624844904"
"31985250929886016737037234388448352929102742708402644340627409931664203093081360"
"70794835812045179006047003875039546061891526346421705014598610179523165038319441"
"51446491086954182492263498716056346893310546875e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
// half way between the two numbers above.
// round to nearest even.
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"1358486831521563686919762403704226016998291015625e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"13584868315215636869197624037042260169982910156250000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
// 9007199254740991 * 2^971 (max normal)
TEST_DOUBLE
(
fullPrecision
,
"1.797693134862315708145274237317043567980705675258449965989174768031572607800285"
"38760589558632766878171540458953514382464234321326889464182768467546703537516986"
"04991057655128207624549009038932894407586850845513394230458323690322294816580855"
"9332123348274797826204144723168738177180919299881250404026184124858368e+308"
,
1.797693134862315708e+308
// 0x1.fffffffffffffp1023
);
#if 0
// ... round up
// TODO:
// Should work at least in full-precision mode...
TEST_DOUBLE(fullPrecision,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"13584868315215636869197624037042260169982910156250000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000001e-308",
4.450147717014402272e-308 // 0x1.fffffffffffffp-1022
);
// TODO:
// Should work at least in full-precision mode...
TEST_DOUBLE(fullPrecision,
"0.00000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000024703282292062327208828439643411068618252"
"9901307162382212792841250337753635104375932649918180817996189"
"8982823477228588654633283551779698981993873980053909390631503"
"5659515570226392290858392449105184435931802849936536152500319"
"3704576782492193656236698636584807570015857692699037063119282"
"7955855133292783433840935197801553124659726357957462276646527"
"2827220056374006485499977096599470454020828166226237857393450"
"7363390079677619305775067401763246736009689513405355374585166"
"6113422376667860416215968046191446729184030053005753084904876"
"5391711386591646239524912623653881879636239373280423891018672"
"3484976682350898633885879256283027559956575244555072551893136"
"9083625477918694866799496832404970582102851318545139621383772"
"2826145437693412532098591327667236328125",
0.0);
#endif
// ... round down
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"13584868315215636869197624037042260169982910156249999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
// 9007199254740991 * 2^-1074 = (2^53 - 1) * 2^-1074
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402272114819593418263951869639092703291296046852219449644444042153"
"89103305904781627017582829831782607924221374017287738918929105531441481564124348"
"67599762821265346585071045737627442980259622449029037796981144446145705102663115"
"10031828794952795966823603998647925096578034214163701381261333311989876551545144"
"03152612538132666529513060001849177663286607555958373922409899478075565940981010"
"21612198814605258742579179000071675999344145086087205681577915435923018910334964"
"86942061405218289243144579760516365090360651414037721744226256159024466852576737"
"24464300755133324500796506867194913776884780053099639677097589658441378944337966"
"21993967316936280457084866613206797017728916080020698679408551343728867675409720"
"757232455434770912461317493580281734466552734375e-308"
,
4.450147717014402272e-308
// 0x1.fffffffffffffp-1022
);
// 9007199254740990 * 2^-1074
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014401778049173752171719775300846224481918930987049605124880018456471"
"39035755177760751831052846195619008686241717547743167145836439860405887584484471"
"19639655002484083577939142623582164522087943959208000909794783876158397872163051"
"22622675229968408654350206725478309956546318828765627255022767720818849892988457"
"26333908582101604036318532842699932130356061901518261174396928478121372742040102"
"17446565569357687263889031732270082446958029584739170416643195242132750803227473"
"16608838720742955671061336566907126801014814608027120593609275183716632624844904"
"31985250929886016737037234388448352929102742708402644340627409931664203093081360"
"70794835812045179006047003875039546061891526346421705014598610179523165038319441"
"51446491086954182492263498716056346893310546875e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
// half way between the two numbers above.
// round to nearest even.
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"1358486831521563686919762403704226016998291015625e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"13584868315215636869197624037042260169982910156250000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
#if 0
// XXX:
// https://travis-ci.org/Tencent/rapidjson/jobs/393054531#L1634
// Slightly below half way between max-normal and infinity.
// Should round down.
TEST_DOUBLE(fullPrecision,
"1.797693134862315807937289714053034150799341327100378269361737789804449682927647"
"50946649017977587207096330286416692887910946555547851940402630657488671505820681"
"90890200070838367627385484581771153176447573027006985557136695962284291481986083"
"49364752927190741684443655107043427115596995080930428801779041744977919999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e+308",
1.797693134862315708e+308 // 0x1.fffffffffffffp1023
);
// ... round up
// TODO:
// Should work at least in full-precision mode...
TEST_DOUBLE(fullPrecision,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"13584868315215636869197624037042260169982910156250000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000001e-308",
4.450147717014402272e-308 // 0x1.fffffffffffffp-1022
);
#endif
// ... round down
TEST_DOUBLE
(
fullPrecision
,
"4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
"64069530541271189424317838013700808305231545782515453032382772695923684574304409"
"93619708911874715081505094180604803751173783204118519353387964161152051487413083"
"16327252012460602310586905362063117526562176521464664318142050516404363222266800"
"64743260560117135282915796422274554896821334728738317548403413978098469341510556"
"19529382191981473003234105366170879223151087335413188049110555339027884856781219"
"01775450062980622457102958163711745945687733011032421168917765671370549738710820"
"78224775842509670618916870627821633352993761380751142008862499795052791018709663"
"46394401564490729731565935244123171539810221213221201847003580761626016356864581"
"13584868315215636869197624037042260169982910156249999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e-308"
,
4.450147717014401778e-308
// 0x1.ffffffffffffep-1022
);
// Slightly below half way between max-normal and infinity.
// Should round down.
TEST_DOUBLE
(
fullPrecision
,
"1.797693134862315807937289714053034150799341327100378269361737789804449682927647"
"50946649017977587207096330286416692887910946555547851940402630657488671505820681"
"90890200070838367627385484581771153176447573027006985557136695962284291481986083"
"49364752927190741684443655107043427115596995080930428801779041744977919999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999"
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e+308"
,
1.797693134862315708e+308
// 0x1.fffffffffffffp1023
);
}
#undef TEST_DOUBLE
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment