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
2689cc49
Commit
2689cc49
authored
Apr 15, 2015
by
miloyip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove more unused code paths in double conversions
parent
402d75a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
biginteger.h
include/rapidjson/internal/biginteger.h
+2
-5
strtod.h
include/rapidjson/internal/strtod.h
+3
-13
No files found.
include/rapidjson/internal/biginteger.h
View file @
2689cc49
...
...
@@ -172,13 +172,10 @@ public:
}
// Compute absolute difference of this and rhs.
//
Return false if this <
rhs
//
Assume this !=
rhs
bool
Difference
(
const
BigInteger
&
rhs
,
BigInteger
*
out
)
const
{
int
cmp
=
Compare
(
rhs
);
if
(
cmp
==
0
)
{
*
out
=
BigInteger
(
0
);
return
false
;
}
RAPIDJSON_ASSERT
(
cmp
!=
0
);
const
BigInteger
*
a
,
*
b
;
// Makes a > b
bool
ret
;
if
(
cmp
<
0
)
{
a
=
&
rhs
;
b
=
this
;
ret
=
true
;
}
...
...
include/rapidjson/internal/strtod.h
View file @
2689cc49
...
...
@@ -104,19 +104,9 @@ inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) {
hS
.
MultiplyPow5
(
hS_Exp5
)
<<=
hS_Exp2
;
BigInteger
delta
(
0
);
bool
adjustToNegative
=
dS
.
Difference
(
bS
,
&
delta
);
int
cmp
=
delta
.
Compare
(
hS
);
// If delta is within 1/2 ULP, check for special case when significand is power of two.
// In this case, need to compare with 1/2h in the lower bound.
if
(
cmp
<
0
&&
adjustToNegative
&&
// within and dS < bS
db
.
IsNormal
()
&&
(
bInt
&
(
bInt
-
1
))
==
0
&&
// Power of 2
db
.
Uint64Value
()
!=
RAPIDJSON_UINT64_C2
(
0x00100000
,
0x00000000
))
// minimum normal number must not do this
{
delta
<<=
1
;
return
delta
.
Compare
(
hS
);
}
return
cmp
;
dS
.
Difference
(
bS
,
&
delta
);
return
delta
.
Compare
(
hS
);
}
inline
bool
StrtodFast
(
double
d
,
int
p
,
double
*
result
)
{
...
...
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