mirror of
https://github.com/fmtlib/fmt.git
synced 2026-11-09 14:50:24 +08:00
Simplify hexfloat comment and retry CI downloads on more 50x errors
This commit is contained in:
parent
6c285ba88a
commit
be39437ee7
8
.github/workflows/linux.yml
vendored
8
.github/workflows/linux.yml
vendored
@ -84,9 +84,9 @@ jobs:
|
||||
sudo apt update
|
||||
sudo apt install libatomic1 libc6-dev libgomp1 libitm1 libmpc3
|
||||
# https://launchpad.net/ubuntu/xenial/amd64/g++-4.9/4.9.3-13ubuntu2
|
||||
# launchpad periodically returns 503s, so retry to avoid flaky CI.
|
||||
# launchpad periodically returns 50x errors, so retry to avoid flaky CI.
|
||||
wget --no-verbose --tries=5 --waitretry=10 \
|
||||
--retry-connrefused --retry-on-http-error=503 \
|
||||
--retry-connrefused --retry-on-http-error=502,503,504 \
|
||||
http://launchpadlibrarian.net/230069137/libmpfr4_3.1.3-2_amd64.deb \
|
||||
http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb \
|
||||
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||
@ -117,9 +117,9 @@ jobs:
|
||||
sudo apt update
|
||||
sudo apt install libtinfo5
|
||||
# https://code.launchpad.net/ubuntu/xenial/amd64/clang-3.6/1:3.6.2-3ubuntu2
|
||||
# launchpad periodically returns 503s, so retry to avoid flaky CI.
|
||||
# launchpad periodically returns 50x errors, so retry to avoid flaky CI.
|
||||
wget --no-verbose --tries=5 --waitretry=10 \
|
||||
--retry-connrefused --retry-on-http-error=503 \
|
||||
--retry-connrefused --retry-on-http-error=502,503,504 \
|
||||
http://launchpadlibrarian.net/230019046/libffi6_3.2.1-4_amd64.deb \
|
||||
http://launchpadlibrarian.net/445346109/libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||
http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
|
||||
|
||||
@ -3109,10 +3109,7 @@ FMT_CONSTEXPR20 void format_hexfloat(Float value, format_specs specs,
|
||||
basic_fp<carrier_uint> f(value);
|
||||
f.e += num_float_significand_bits;
|
||||
if (!has_implicit_bit<Float>()) --f.e;
|
||||
|
||||
// basic_fp maps a zero biased exponent to the minimum subnormal exponent,
|
||||
// which is correct for subnormals but not for zero: printf prints zero as
|
||||
// 0x0p+0. A zero significand can only come from +-0, so reset the exponent.
|
||||
// Reset the exponent for zero to print it as 0x0p+0.
|
||||
if (f.f == 0) f.e = 0;
|
||||
|
||||
const auto num_fraction_bits =
|
||||
@ -3137,7 +3134,7 @@ FMT_CONSTEXPR20 void format_hexfloat(Float value, format_specs specs,
|
||||
f.f &= ~(inc - 1);
|
||||
}
|
||||
|
||||
// Check long double overflow
|
||||
// Check long double overflow.
|
||||
if (!has_implicit_bit<Float>()) {
|
||||
const auto implicit_bit = carrier_uint(1) << num_float_significand_bits;
|
||||
if ((f.f & implicit_bit) == implicit_bit) {
|
||||
@ -3153,7 +3150,7 @@ FMT_CONSTEXPR20 void format_hexfloat(Float value, format_specs specs,
|
||||
detail::fill_n(xdigits, sizeof(xdigits), '0');
|
||||
format_base2e(4, xdigits, f.f, num_xdigits, specs.upper());
|
||||
|
||||
// Remove zero tail
|
||||
// Remove zero tail.
|
||||
while (print_xdigits > 0 && xdigits[print_xdigits] == '0') --print_xdigits;
|
||||
|
||||
buf.push_back('0');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user