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
6240d020
Commit
6240d020
authored
Jan 18, 2022
by
Junekey Jeon
Committed by
Victor Zverovich
Jan 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments
parent
925b744a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
include/fmt/format-inl.h
include/fmt/format-inl.h
+9
-5
No files found.
include/fmt/format-inl.h
View file @
6240d020
...
...
@@ -2035,11 +2035,15 @@ template <typename T> decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT {
const
carrier_uint
two_fc
=
significand
<<
1
;
// For the case of binary32, the result of integer check is not correct for
// 29711844 * 2^-81, and it is the unique counterexample. However, since
// 29711844 is even, this does not cause any problem for the endpoints; it can
// only cause a problem when we need to perform integer check for the center.
// Fortunately, with the input 297184444 * 2^-81, that branch is never
// executed, so we are fine.
// 29711844 * 2^-82
// = 6.1442653300000000008655037797566933477355632930994033813476... * 10^-18
// and 29711844 * 2^-81
// = 1.2288530660000000001731007559513386695471126586198806762695... * 10^-17,
// and they are the unique counterexamples. However, since 29711844 is even,
// this does not cause any problem for the endpoints calculations; it can only
// cause a problem when we need to perform integer check for the center.
// Fortunately, with these inputs, that branch is never executed, so we are
// fine.
const
typename
cache_accessor
<
T
>::
compute_mul_result
z_mul
=
cache_accessor
<
T
>::
compute_mul
((
two_fc
|
1
)
<<
beta_minus_1
,
cache
);
...
...
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