mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
additional type usage fixes and constexpr.
This commit is contained in:
parent
afbb803aa4
commit
d5c05e51af
@ -39,7 +39,7 @@ constexpr static uint64_t powers_of_ten_uint64[] = {1UL,
|
|||||||
// effect on performance: in order to have a faster algorithm, we'd need
|
// effect on performance: in order to have a faster algorithm, we'd need
|
||||||
// to slow down performance for faster algorithms, and this is still fast.
|
// to slow down performance for faster algorithms, and this is still fast.
|
||||||
template <typename UC>
|
template <typename UC>
|
||||||
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 int_fast16_t
|
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 am_pow_t
|
||||||
scientific_exponent(parsed_number_string_t<UC> const &num) noexcept {
|
scientific_exponent(parsed_number_string_t<UC> const &num) noexcept {
|
||||||
am_mant_t mantissa = num.mantissa;
|
am_mant_t mantissa = num.mantissa;
|
||||||
am_pow_t exponent = num.exponent;
|
am_pow_t exponent = num.exponent;
|
||||||
@ -268,7 +268,7 @@ parse_mantissa(bigint &result, const parsed_number_string_t<UC> &num) noexcept {
|
|||||||
// try to minimize the number of big integer and scalar multiplication.
|
// try to minimize the number of big integer and scalar multiplication.
|
||||||
// therefore, try to parse 8 digits at a time, and multiply by the largest
|
// therefore, try to parse 8 digits at a time, and multiply by the largest
|
||||||
// scalar value (9 or 19 digits) for each step.
|
// scalar value (9 or 19 digits) for each step.
|
||||||
am_digits const max_digits = binary_format<T>::max_digits();
|
constexpr am_digits max_digits = binary_format<T>::max_digits();
|
||||||
am_digits counter = 0;
|
am_digits counter = 0;
|
||||||
am_digits digits = 0;
|
am_digits digits = 0;
|
||||||
limb value = 0;
|
limb value = 0;
|
||||||
|
|||||||
@ -336,7 +336,7 @@ struct value128 {
|
|||||||
|
|
||||||
/* Helper C++14 constexpr generic implementation of leading_zeroes */
|
/* Helper C++14 constexpr generic implementation of leading_zeroes */
|
||||||
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 limb_t
|
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 limb_t
|
||||||
leading_zeroes_generic(uint64_t input_num, uint64_t last_bit = 0) noexcept {
|
leading_zeroes_generic(uint64_t input_num, uint32_t last_bit = 0) noexcept {
|
||||||
if (input_num & uint64_t(0xffffffff00000000)) {
|
if (input_num & uint64_t(0xffffffff00000000)) {
|
||||||
input_num >>= 32;
|
input_num >>= 32;
|
||||||
last_bit |= 32;
|
last_bit |= 32;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user