mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 09:16:50 +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)) {
|
||||
// a multiplication by 10 is cheaper than an arbitrary integer
|
||||
// multiplication
|
||||
answer.mantissa =
|
||||
10 * answer.mantissa +
|
||||
UC(*p - UC('0')); // might overflow, we will handle the overflow later
|
||||
answer.mantissa = static_cast<fast_float::am_mant_t>(
|
||||
answer.mantissa * 10 +
|
||||
UC(*p - UC('0'))); // might overflow, we will handle the overflow later
|
||||
++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)) {
|
||||
UC const digit = UC(*p - UC('0'));
|
||||
answer.mantissa =
|
||||
answer.mantissa = static_cast<fast_float::am_mant_t>(
|
||||
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;
|
||||
}
|
||||
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.
|
||||
FASTFLOAT_CONSTEXPR20 bigint_bits_t bit_length() const noexcept {
|
||||
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); }
|
||||
|
||||
@ -72,7 +72,7 @@ constexpr fastfloat_really_inline am_pow_t power(am_pow_t q) noexcept {
|
||||
template <typename binary>
|
||||
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 adjusted_mantissa
|
||||
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;
|
||||
answer.mantissa = w << hilz;
|
||||
constexpr am_pow_t bias =
|
||||
|
||||
@ -355,7 +355,8 @@ inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa positive_digit_comp(
|
||||
am.mantissa = bigmant.hi64(truncated);
|
||||
constexpr am_pow_t bias = binary_format<T>::mantissa_explicit_bits() -
|
||||
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_nearest_tie_even(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user