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
9b62310f
Commit
9b62310f
authored
Feb 08, 2022
by
Junekey Jeon
Committed by
Victor Zverovich
Feb 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some conversion issues
parent
08d12f31
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/fmt/format-inl.h
include/fmt/format-inl.h
+2
-2
No files found.
include/fmt/format-inl.h
View file @
9b62310f
...
...
@@ -328,7 +328,7 @@ FMT_CONSTEXPR inline fp get_cached_power(int min_exponent,
int
&
pow10_exponent
)
{
const
int
shift
=
32
;
// log10(2) = 0x0.4d104d427de7fbcc...
const
auto
significand
=
static_cast
<
int64_t
>
(
0x4d104d427de7fbcc
)
;
const
int64_t
significand
=
0x4d104d427de7fbcc
;
int
index
=
static_cast
<
int
>
(
((
min_exponent
+
fp
::
num_significand_bits
-
1
)
*
(
significand
>>
shift
)
+
((
int64_t
(
1
)
<<
shift
)
-
1
))
// ceil
...
...
@@ -963,7 +963,7 @@ template <int N> uint32_t small_division_by_pow10(uint32_t n) noexcept {
// Computes floor(n / 10^(kappa + 1)) (float)
inline
uint32_t
divide_by_10_to_kappa_plus_1
(
uint32_t
n
)
noexcept
{
// 1374389535 = ceil(2^37/100)
return
(
static_cast
<
uint64_t
>
(
n
)
*
1374389535
)
>>
37
;
return
static_cast
<
uint32_t
>
((
static_cast
<
uint64_t
>
(
n
)
*
1374389535
)
>>
37
)
;
}
// Computes floor(n / 10^(kappa + 1)) (double)
inline
uint64_t
divide_by_10_to_kappa_plus_1
(
uint64_t
n
)
noexcept
{
...
...
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