From be39437ee71162931d3d06d523b4544029656955 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 12 Aug 2026 08:05:04 -0700 Subject: [PATCH] Simplify hexfloat comment and retry CI downloads on more 50x errors --- .github/workflows/linux.yml | 8 ++++---- include/fmt/format.h | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8d45e478..b3e511f8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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 \ diff --git a/include/fmt/format.h b/include/fmt/format.h index 13fb9138..d74c3e93 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3109,10 +3109,7 @@ FMT_CONSTEXPR20 void format_hexfloat(Float value, format_specs specs, basic_fp f(value); f.e += num_float_significand_bits; if (!has_implicit_bit()) --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()) { 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');