mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
compilation fix.
This commit is contained in:
parent
e446899538
commit
6f789de5d2
@ -334,7 +334,8 @@ parse_number_string(UC const *p, UC const *pend,
|
||||
// multiplication
|
||||
answer.mantissa = static_cast<fast_float::am_mant_t>(
|
||||
answer.mantissa * 10 +
|
||||
UC(*p - UC('0'))); // might overflow, we will handle the overflow later
|
||||
static_cast<fast_float::am_mant_t>(
|
||||
*p - UC('0'))); // might overflow, we will handle the overflow later
|
||||
++p;
|
||||
}
|
||||
UC const *const end_of_integer_part = p;
|
||||
@ -391,9 +392,9 @@ parse_number_string(UC const *p, UC const *pend,
|
||||
// Now we can parse the explicit exponential part.
|
||||
am_pow_t exp_number = 0; // explicit exponential part
|
||||
if ((p != pend) &&
|
||||
(chars_format_t(options.format & chars_format::scientific) &&
|
||||
(UC('e') == *p) ||
|
||||
(UC('E') == *p))
|
||||
((chars_format_t(options.format & chars_format::scientific) &&
|
||||
(UC('e') == *p) ||
|
||||
(UC('E') == *p)))
|
||||
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||
|| (chars_format_t(options.format & detail::basic_fortran_fmt) &&
|
||||
((UC('+') == *p) || (UC('-') == *p) || (UC('d') == *p) ||
|
||||
@ -421,9 +422,9 @@ parse_number_string(UC const *p, UC const *pend,
|
||||
}
|
||||
if ((p == pend) || !is_integer(*p)) {
|
||||
if (!chars_format_t(options.format & chars_format::fixed)) {
|
||||
// The exponential part is invalid for scientific notation, so it must
|
||||
// be a trailing token for fixed notation. However, fixed notation is
|
||||
// disabled, so report a scientific notation error.
|
||||
// The exponential part is invalid for scientific notation, so it
|
||||
// must be a trailing token for fixed notation. However, fixed
|
||||
// notation is disabled, so report a scientific notation error.
|
||||
return report_parse_error<UC>(p, parse_error::missing_exponential_part);
|
||||
}
|
||||
// Otherwise, we will be ignoring the 'e'.
|
||||
|
||||
@ -67,7 +67,7 @@ template <limb_t size> struct stackvec {
|
||||
// index from the end of the container
|
||||
FASTFLOAT_CONSTEXPR14 const limb &rindex(limb_t index) const noexcept {
|
||||
FASTFLOAT_DEBUG_ASSERT(index < length);
|
||||
limb_t rindex = length - index - 1;
|
||||
limb_t rindex = static_cast<limb_t>(length - index - 1);
|
||||
return data[rindex];
|
||||
}
|
||||
|
||||
@ -590,7 +590,9 @@ struct bigint : pow5_tables<> {
|
||||
FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
|
||||
|
||||
// multiply as if by 2 raised to a power.
|
||||
FASTFLOAT_CONSTEXPR20 bool pow2(am_pow_t exp) noexcept { return shl(exp); }
|
||||
FASTFLOAT_CONSTEXPR20 bool pow2(am_pow_t exp) noexcept {
|
||||
return shl(static_cast<fast_float::bigint_bits_t>(exp));
|
||||
}
|
||||
|
||||
// multiply as if by 5 raised to a power.
|
||||
FASTFLOAT_CONSTEXPR20 bool pow5(am_pow_t exp) noexcept {
|
||||
|
||||
@ -457,7 +457,7 @@ inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa digit_comp(
|
||||
|
||||
am_digits const digits = parse_mantissa<T, UC>(bigmant, num);
|
||||
// can't underflow, since digits is at most max_digits.
|
||||
am_pow_t const exponent = sci_exp + 1 - digits;
|
||||
am_pow_t const exponent = static_cast<am_pow_t>(sci_exp + 1 - digits);
|
||||
if (exponent >= 0) {
|
||||
return positive_digit_comp<T>(bigmant, am, exponent);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user