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
dfba62e1
Commit
dfba62e1
authored
Apr 10, 2015
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed two -Wfloat-equal warnings
parent
53ed550a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
diyfp.h
include/rapidjson/internal/diyfp.h
+1
-1
dtoa.h
include/rapidjson/internal/dtoa.h
+2
-2
ieee754.h
include/rapidjson/internal/ieee754.h
+1
-0
No files found.
include/rapidjson/internal/diyfp.h
View file @
dfba62e1
...
...
@@ -238,7 +238,7 @@ inline DiyFp GetCachedPower(int e, int* K) {
//int k = static_cast<int>(ceil((-61 - e) * 0.30102999566398114)) + 374;
double
dk
=
(
-
61
-
e
)
*
0
.
30102999566398114
+
347
;
// dk must be positive, so can do ceiling in positive
int
k
=
static_cast
<
int
>
(
dk
);
if
(
k
!=
dk
)
if
(
dk
-
k
>
0
.
0
)
k
++
;
unsigned
index
=
static_cast
<
unsigned
>
((
k
>>
3
)
+
1
);
...
...
include/rapidjson/internal/dtoa.h
View file @
dfba62e1
...
...
@@ -193,8 +193,8 @@ inline char* Prettify(char* buffer, int length, int k) {
}
inline
char
*
dtoa
(
double
value
,
char
*
buffer
)
{
if
(
value
==
0
)
{
Double
d
(
value
);
Double
d
(
value
);
if
(
d
.
IsZero
())
{
if
(
d
.
Sign
())
*
buffer
++
=
'-'
;
// -0.0, Issue #289
buffer
[
0
]
=
'0'
;
...
...
include/rapidjson/internal/ieee754.h
View file @
dfba62e1
...
...
@@ -49,6 +49,7 @@ public:
bool
IsNan
()
const
{
return
(
u
&
kExponentMask
)
==
kExponentMask
&&
Significand
()
!=
0
;
}
bool
IsInf
()
const
{
return
(
u
&
kExponentMask
)
==
kExponentMask
&&
Significand
()
==
0
;
}
bool
IsNormal
()
const
{
return
(
u
&
kExponentMask
)
!=
0
||
Significand
()
==
0
;
}
bool
IsZero
()
const
{
return
(
u
&
(
kExponentMask
|
kSignificandMask
))
==
0
;
}
uint64_t
IntegerSignificand
()
const
{
return
IsNormal
()
?
Significand
()
|
kHiddenBit
:
Significand
();
}
int
IntegerExponent
()
const
{
return
(
IsNormal
()
?
Exponent
()
:
kDenormalExponent
)
-
kSignificandSize
;
}
...
...
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