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
027fcaf0
Commit
027fcaf0
authored
Sep 26, 2021
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace use_grisu with fallback since Grisu is only one of multiple implemented algorithms
parent
716d69f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
include/fmt/core.h
include/fmt/core.h
+1
-1
include/fmt/format-inl.h
include/fmt/format-inl.h
+1
-1
include/fmt/format.h
include/fmt/format.h
+1
-1
No files found.
include/fmt/core.h
View file @
027fcaf0
...
...
@@ -2676,7 +2676,7 @@ struct float_specs {
bool
upper
:
1
;
bool
locale
:
1
;
bool
binary32
:
1
;
bool
use_grisu
:
1
;
bool
fallback
:
1
;
bool
showpoint
:
1
;
};
...
...
include/fmt/format-inl.h
View file @
027fcaf0
...
...
@@ -2375,7 +2375,7 @@ FMT_HEADER_ONLY_CONSTEXPR20 int format_float(Float value, int precision,
return
-
precision
;
}
if
(
!
specs
.
use_grisu
)
return
snprintf_float
(
value
,
precision
,
specs
,
buf
);
if
(
specs
.
fallback
)
return
snprintf_float
(
value
,
precision
,
specs
,
buf
);
if
(
!
is_constant_evaluated
()
&&
precision
<
0
)
{
// Use Dragonbox for the shortest format.
...
...
include/fmt/format.h
View file @
027fcaf0
...
...
@@ -1995,7 +1995,7 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value,
++
precision
;
}
if
(
const_check
(
std
::
is_same
<
T
,
float
>
()))
fspecs
.
binary32
=
true
;
fspecs
.
use_grisu
=
is_fast_float
<
T
>
()
;
if
(
!
is_fast_float
<
T
>
())
fspecs
.
fallback
=
true
;
int
exp
=
format_float
(
promote_float
(
value
),
precision
,
fspecs
,
buffer
);
fspecs
.
precision
=
precision
;
auto
fp
=
big_decimal_fp
{
buffer
.
data
(),
static_cast
<
int
>
(
buffer
.
size
()),
exp
};
...
...
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