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
22ca9312
Commit
22ca9312
authored
Nov 14, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gcc/clang compilation errors and turn off exhaustive number test
parent
40852f4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
strtod.h
include/rapidjson/internal/strtod.h
+3
-3
readertest.cpp
test/unittest/readertest.cpp
+1
-1
No files found.
include/rapidjson/internal/strtod.h
View file @
22ca9312
...
...
@@ -147,8 +147,8 @@ inline bool StrtodDiyFp(const char* decimals, size_t length, size_t decimalPosit
uint64_t
significand
=
0
;
size_t
i
=
0
;
// 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999
for
(;
i
<
length
;
i
++
)
{
if
(
significand
>
RAPIDJSON_UINT64_C2
(
0x19999999
,
0x99999999
)
||
significand
==
RAPIDJSON_UINT64_C2
(
0x19999999
,
0x99999999
)
&&
decimals
[
i
]
>
'5'
)
if
(
significand
>
RAPIDJSON_UINT64_C2
(
0x19999999
,
0x99999999
)
||
(
significand
==
RAPIDJSON_UINT64_C2
(
0x19999999
,
0x99999999
)
&&
decimals
[
i
]
>
'5'
)
)
break
;
significand
=
significand
*
10
+
(
decimals
[
i
]
-
'0'
);
}
...
...
@@ -262,7 +262,7 @@ inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t
// Trim right-most digits
const
int
kMaxDecimalDigit
=
780
;
if
(
length
>
kMaxDecimalDigit
)
{
if
(
(
int
)
length
>
kMaxDecimalDigit
)
{
exp
+=
(
int
(
length
)
-
kMaxDecimalDigit
);
length
=
kMaxDecimalDigit
;
}
...
...
test/unittest/readertest.cpp
View file @
22ca9312
...
...
@@ -257,7 +257,7 @@ static void TestParseDouble() {
TEST_DOUBLE
(
fullPrecision
,
n1e308
,
1E308
);
}
#if
1
#if
0 // Very slow
static const unsigned count = 10000000;
// Random test for 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