mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-10 20:29:55 +08:00
compilation fix.
This commit is contained in:
parent
a3ccc1f7b1
commit
e446899538
@ -332,9 +332,9 @@ parse_number_string(UC const *p, UC const *pend,
|
|||||||
while ((p != pend) && is_integer(*p)) {
|
while ((p != pend) && is_integer(*p)) {
|
||||||
// a multiplication by 10 is cheaper than an arbitrary integer
|
// a multiplication by 10 is cheaper than an arbitrary integer
|
||||||
// multiplication
|
// multiplication
|
||||||
answer.mantissa =
|
answer.mantissa = static_cast<fast_float::am_mant_t>(
|
||||||
10 * answer.mantissa +
|
answer.mantissa * 10 +
|
||||||
UC(*p - UC('0')); // might overflow, we will handle the overflow later
|
UC(*p - UC('0'))); // might overflow, we will handle the overflow later
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
UC const *const end_of_integer_part = p;
|
UC const *const end_of_integer_part = p;
|
||||||
@ -364,9 +364,9 @@ parse_number_string(UC const *p, UC const *pend,
|
|||||||
|
|
||||||
while ((p != pend) && is_integer(*p)) {
|
while ((p != pend) && is_integer(*p)) {
|
||||||
UC const digit = UC(*p - UC('0'));
|
UC const digit = UC(*p - UC('0'));
|
||||||
answer.mantissa =
|
answer.mantissa = static_cast<fast_float::am_mant_t>(
|
||||||
answer.mantissa * 10 +
|
answer.mantissa * 10 +
|
||||||
digit; // in rare cases, this will overflow, but that's ok
|
digit); // in rare cases, this will overflow, but that's ok
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
answer.exponent = static_cast<am_pow_t>(before - p);
|
answer.exponent = static_cast<am_pow_t>(before - p);
|
||||||
|
|||||||
@ -582,7 +582,7 @@ struct bigint : pow5_tables<> {
|
|||||||
// get the number of bits in the bigint.
|
// get the number of bits in the bigint.
|
||||||
FASTFLOAT_CONSTEXPR20 bigint_bits_t bit_length() const noexcept {
|
FASTFLOAT_CONSTEXPR20 bigint_bits_t bit_length() const noexcept {
|
||||||
limb_t lz = ctlz();
|
limb_t lz = ctlz();
|
||||||
return limb_bits * vec.len() - lz;
|
return static_cast<fast_float::bigint_bits_t>(limb_bits * vec.len() - lz);
|
||||||
}
|
}
|
||||||
|
|
||||||
FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
|
FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
|
||||||
|
|||||||
@ -72,7 +72,7 @@ constexpr fastfloat_really_inline am_pow_t power(am_pow_t q) noexcept {
|
|||||||
template <typename binary>
|
template <typename binary>
|
||||||
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 adjusted_mantissa
|
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 adjusted_mantissa
|
||||||
compute_error_scaled(int64_t q, uint64_t w, int32_t lz) noexcept {
|
compute_error_scaled(int64_t q, uint64_t w, int32_t lz) noexcept {
|
||||||
am_pow_t hilz = uint64_t(w >> 63) ^ 1;
|
am_pow_t hilz = static_cast<am_pow_t>(uint64_t(w >> 63) ^ 1);
|
||||||
adjusted_mantissa answer;
|
adjusted_mantissa answer;
|
||||||
answer.mantissa = w << hilz;
|
answer.mantissa = w << hilz;
|
||||||
constexpr am_pow_t bias =
|
constexpr am_pow_t bias =
|
||||||
|
|||||||
@ -355,7 +355,8 @@ inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa positive_digit_comp(
|
|||||||
am.mantissa = bigmant.hi64(truncated);
|
am.mantissa = bigmant.hi64(truncated);
|
||||||
constexpr am_pow_t bias = binary_format<T>::mantissa_explicit_bits() -
|
constexpr am_pow_t bias = binary_format<T>::mantissa_explicit_bits() -
|
||||||
binary_format<T>::minimum_exponent();
|
binary_format<T>::minimum_exponent();
|
||||||
am.power2 = bigmant.bit_length() - 64 + bias;
|
am.power2 =
|
||||||
|
static_cast<fast_float::am_pow_t>(bigmant.bit_length() - 64 + bias);
|
||||||
|
|
||||||
round<T>(am, [truncated](adjusted_mantissa &a, am_pow_t shift) {
|
round<T>(am, [truncated](adjusted_mantissa &a, am_pow_t shift) {
|
||||||
round_nearest_tie_even(
|
round_nearest_tie_even(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user