From 18ee067179976a20e54efbc8e6ade1da7dacae62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Wed, 23 Sep 2026 19:29:26 +0200 Subject: [PATCH] Apply clang-format Co-Authored-By: Claude Opus 5.5 (1M context) --- include/fast_float/decimal_to_binary.h | 7 +++---- include/fast_float/parse_number.h | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fast_float/decimal_to_binary.h b/include/fast_float/decimal_to_binary.h index ecd9cbc..b9b96f4 100644 --- a/include/fast_float/decimal_to_binary.h +++ b/include/fast_float/decimal_to_binary.h @@ -104,10 +104,9 @@ compute_float(int64_t q, uint64_t w) noexcept { adjusted_mantissa answer; // One comparison for both ends of the range, then zero vs infinity without // a branch: it follows the sign of the exponent, which is unpredictable. - bool const q_out_of_range = - uint64_t(q - binary::smallest_power_of_ten()) > - uint64_t(binary::largest_power_of_ten() - - binary::smallest_power_of_ten()); + bool const q_out_of_range = uint64_t(q - binary::smallest_power_of_ten()) > + uint64_t(binary::largest_power_of_ten() - + binary::smallest_power_of_ten()); if ((w == 0) || q_out_of_range) { bool const underflow = (w == 0) | (q < binary::smallest_power_of_ten()); answer.power2 = int32_t(!underflow) * binary::infinite_power(); diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index ef8ba96..6aa4c34 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -458,8 +458,9 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value, // Test for over/underflow. One comparison catches both a zero and an // infinite exponent, so normal values pay a single, never-taken branch. The // result is then selected: which case it is follows the sign of the exponent. - if fastfloat_clang_unlikely (uint32_t(am.power2 - 1) >= - uint32_t(binary_format::infinite_power() - 1)) { + constexpr uint32_t max_power2 = + uint32_t(binary_format::infinite_power() - 1); + if fastfloat_clang_unlikely (uint32_t(am.power2 - 1) >= max_power2) { bool const out_of_range = (am.power2 != 0) | ((am.mantissa == 0) & (pns.mantissa != 0)); answer.ec = out_of_range ? std::errc::result_out_of_range : answer.ec;