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
6cd5cd7b
Commit
6cd5cd7b
authored
Jun 15, 2018
by
abolz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Debug - Initialize variable]
parent
292f787c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
strtod.h
include/rapidjson/internal/strtod.h
+11
-11
No files found.
include/rapidjson/internal/strtod.h
View file @
6cd5cd7b
...
@@ -155,13 +155,13 @@ inline bool StrtodDiyFp(const char* decimals, int dLen, int dExp, double* result
...
@@ -155,13 +155,13 @@ inline bool StrtodDiyFp(const char* decimals, int dLen, int dExp, double* result
DiyFp
cachedPower
=
GetCachedPower10
(
dExp
,
&
actualExp
);
DiyFp
cachedPower
=
GetCachedPower10
(
dExp
,
&
actualExp
);
if
(
actualExp
!=
dExp
)
{
if
(
actualExp
!=
dExp
)
{
static
const
DiyFp
kPow10
[]
=
{
static
const
DiyFp
kPow10
[]
=
{
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xa0000000
,
00000000
),
-
60
),
// 10^1
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xa0000000
,
0
x0
0000000
),
-
60
),
// 10^1
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xc8000000
,
00000000
),
-
57
),
// 10^2
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xc8000000
,
0
x0
0000000
),
-
57
),
// 10^2
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xfa000000
,
00000000
),
-
54
),
// 10^3
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xfa000000
,
0
x0
0000000
),
-
54
),
// 10^3
DiyFp
(
RAPIDJSON_UINT64_C2
(
0x9c400000
,
00000000
),
-
50
),
// 10^4
DiyFp
(
RAPIDJSON_UINT64_C2
(
0x9c400000
,
0
x0
0000000
),
-
50
),
// 10^4
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xc3500000
,
00000000
),
-
47
),
// 10^5
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xc3500000
,
0
x0
0000000
),
-
47
),
// 10^5
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xf4240000
,
00000000
),
-
44
),
// 10^6
DiyFp
(
RAPIDJSON_UINT64_C2
(
0xf4240000
,
0
x0
0000000
),
-
44
),
// 10^6
DiyFp
(
RAPIDJSON_UINT64_C2
(
0x98968000
,
00000000
),
-
40
)
// 10^7
DiyFp
(
RAPIDJSON_UINT64_C2
(
0x98968000
,
0
x0
0000000
),
-
40
)
// 10^7
};
};
int
adjustment
=
dExp
-
actualExp
;
int
adjustment
=
dExp
-
actualExp
;
RAPIDJSON_ASSERT
(
adjustment
>=
1
&&
adjustment
<
8
);
RAPIDJSON_ASSERT
(
adjustment
>=
1
&&
adjustment
<
8
);
...
@@ -204,9 +204,9 @@ inline bool StrtodDiyFp(const char* decimals, int dLen, int dExp, double* result
...
@@ -204,9 +204,9 @@ inline bool StrtodDiyFp(const char* decimals, int dLen, int dExp, double* result
return
halfWay
-
static_cast
<
unsigned
>
(
error
)
>=
precisionBits
||
precisionBits
>=
halfWay
+
static_cast
<
unsigned
>
(
error
);
return
halfWay
-
static_cast
<
unsigned
>
(
error
)
>=
precisionBits
||
precisionBits
>=
halfWay
+
static_cast
<
unsigned
>
(
error
);
}
}
inline
double
StrtodBigInteger
(
double
approx
,
const
char
*
decimals
,
int
length
,
int
dExp
)
{
inline
double
StrtodBigInteger
(
double
approx
,
const
char
*
decimals
,
int
dLen
,
int
dExp
)
{
RAPIDJSON_ASSERT
(
length
>=
0
);
RAPIDJSON_ASSERT
(
dLen
>=
0
);
const
BigInteger
dInt
(
decimals
,
static_cast
<
unsigned
>
(
length
));
const
BigInteger
dInt
(
decimals
,
static_cast
<
unsigned
>
(
dLen
));
Double
a
(
approx
);
Double
a
(
approx
);
int
cmp
=
CheckWithinHalfULP
(
a
.
Value
(),
dInt
,
dExp
);
int
cmp
=
CheckWithinHalfULP
(
a
.
Value
(),
dInt
,
dExp
);
if
(
cmp
<
0
)
if
(
cmp
<
0
)
...
@@ -226,7 +226,7 @@ inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t
...
@@ -226,7 +226,7 @@ inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t
RAPIDJSON_ASSERT
(
d
>=
0
.
0
);
RAPIDJSON_ASSERT
(
d
>=
0
.
0
);
RAPIDJSON_ASSERT
(
length
>=
1
);
RAPIDJSON_ASSERT
(
length
>=
1
);
double
result
;
double
result
=
0
.
0
;
if
(
StrtodFast
(
d
,
p
,
&
result
))
if
(
StrtodFast
(
d
,
p
,
&
result
))
return
result
;
return
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