Fix a UB on ridiculously large precision

This commit is contained in:
Victor Zverovich 2020-10-11 06:47:51 -07:00
parent 01c37e0a4b
commit 41d97e1ef4

View File

@ -1804,7 +1804,7 @@ OutputIt write_float(OutputIt out, const DecimalFP& fp,
int significand_size = get_significand_size(fp); int significand_size = get_significand_size(fp);
static const Char zero = static_cast<Char>('0'); static const Char zero = static_cast<Char>('0');
auto sign = fspecs.sign; auto sign = fspecs.sign;
int size = significand_size + (sign ? 1 : 0); long long size = significand_size + (sign ? 1 : 0);
using iterator = remove_reference_t<decltype(reserve(out, 0))>; using iterator = remove_reference_t<decltype(reserve(out, 0))>;
int output_exp = fp.exponent + significand_size - 1; int output_exp = fp.exponent + significand_size - 1;