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
4e9b4f6d
Commit
4e9b4f6d
authored
Jun 15, 2018
by
abolz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 0 if binary exponent is too small
parent
f5e5d47f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
diyfp.h
include/rapidjson/internal/diyfp.h
+4
-1
readertest.cpp
test/unittest/readertest.cpp
+9
-0
No files found.
include/rapidjson/internal/diyfp.h
View file @
4e9b4f6d
...
...
@@ -142,7 +142,10 @@ struct DiyFp {
uint64_t
u64
;
}
u
;
RAPIDJSON_ASSERT
(
f
<=
kDpHiddenBit
+
kDpSignificandMask
);
RAPIDJSON_ASSERT
(
e
>=
kDpDenormalExponent
);
if
(
e
<
kDpDenormalExponent
)
{
// Underflow.
return
0
.
0
;
}
RAPIDJSON_ASSERT
(
e
<
kDpMaxExponent
);
const
uint64_t
be
=
(
e
==
kDpDenormalExponent
&&
(
f
&
kDpHiddenBit
)
==
0
)
?
0
:
static_cast
<
uint64_t
>
(
e
+
kDpExponentBias
);
...
...
test/unittest/readertest.cpp
View file @
4e9b4f6d
...
...
@@ -392,6 +392,15 @@ 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"
,
2.4703282292062328e-324
);
TEST_DOUBLE
(
fullPrecision
,
"2.48e-324"
,
2.48e-324
);
TEST_DOUBLE
(
fullPrecision
,
"2.5e-324"
,
2.5e-324
);
#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