Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
27c2e880
Commit
27c2e880
authored
Nov 02, 2015
by
Ingo van Lil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warning when building with -Wfloat-equal
parent
b4b13ee2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
format.h
format.h
+14
-1
No files found.
format.h
View file @
27c2e880
...
...
@@ -594,6 +594,15 @@ inline int isinfinity(long double x) { return isinf(x); }
inline
int
isinfinity
(
double
x
)
{
return
std
::
isinf
(
x
);
}
inline
int
isinfinity
(
long
double
x
)
{
return
std
::
isinf
(
x
);
}
# endif
// Portable version of isnan.
# ifdef isnan
inline
int
isnotanumber
(
double
x
)
{
return
isnan
(
x
);
}
inline
int
isnotanumber
(
long
double
x
)
{
return
isnan
(
x
);
}
# else
inline
int
isnotanumber
(
double
x
)
{
return
std
::
isnan
(
x
);
}
inline
int
isnotanumber
(
long
double
x
)
{
return
std
::
isnan
(
x
);
}
# endif
#else
inline
int
getsign
(
double
value
)
{
if
(
value
<
0
)
return
1
;
...
...
@@ -607,6 +616,10 @@ inline int isinfinity(double x) { return !_finite(x); }
inline
int
isinfinity
(
long
double
x
)
{
return
!
_finite
(
static_cast
<
double
>
(
x
));
}
inline
int
isnotanumber
(
double
x
)
{
return
_isnan
(
x
);
}
inline
int
isnotanumber
(
long
double
x
)
{
return
_isnan
(
static_cast
<
double
>
(
x
));
}
#endif
template
<
typename
Char
>
...
...
@@ -2378,7 +2391,7 @@ void BasicWriter<Char>::write_double(
sign
=
spec
.
flag
(
PLUS_FLAG
)
?
'+'
:
' '
;
}
if
(
value
!=
value
)
{
if
(
internal
::
isnotanumber
(
value
)
)
{
// Format NaN ourselves because sprintf's output is not consistent
// across platforms.
std
::
size_t
nan_size
=
4
;
...
...
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