[libc-commits] [libc] [libc][NFC] Introduce a Sign type for FPBits (PR #78500)

via libc-commits libc-commits at lists.llvm.org
Wed Jan 17 12:32:50 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff badf0ee80c2b53bbc227f5d12c74819c01ceaf3c 0e41c24f5f78374e7a2816dc886d338eff3b092b -- libc/src/__support/FPUtil/BasicOperations.h libc/src/__support/FPUtil/DivisionAndRemainderOperations.h libc/src/__support/FPUtil/FPBits.h libc/src/__support/FPUtil/ManipulationFunctions.h libc/src/__support/FPUtil/NearestIntegerOperations.h libc/src/__support/FPUtil/NormalFloat.h libc/src/__support/FPUtil/dyadic_float.h libc/src/__support/FPUtil/fpbits_str.h libc/src/__support/FPUtil/generic/FMA.h libc/src/__support/FPUtil/generic/FMod.h libc/src/__support/FPUtil/generic/sqrt.h libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h libc/src/__support/float_to_string.h libc/src/__support/str_to_float.h libc/src/math/generic/acosf.cpp libc/src/math/generic/asinf.cpp libc/src/math/generic/atanf.cpp libc/src/math/generic/atanhf.cpp libc/src/math/generic/cosf.cpp libc/src/math/generic/coshf.cpp libc/src/math/generic/erff.cpp libc/src/math/generic/exp10f_impl.h libc/src/math/generic/exp2f_impl.h libc/src/math/generic/expf.cpp libc/src/math/generic/expm1.cpp libc/src/math/generic/expm1f.cpp libc/src/math/generic/inv_trigf_utils.h libc/src/math/generic/log.cpp libc/src/math/generic/log10.cpp libc/src/math/generic/log10f.cpp libc/src/math/generic/log1p.cpp libc/src/math/generic/log1pf.cpp libc/src/math/generic/log2.cpp libc/src/math/generic/log2f.cpp libc/src/math/generic/logf.cpp libc/src/math/generic/powf.cpp libc/src/math/generic/sinf.cpp libc/src/math/generic/sinhf.cpp libc/src/math/generic/tanhf.cpp libc/src/stdio/printf_core/float_dec_converter.h libc/src/stdio/printf_core/float_hex_converter.h libc/src/stdio/printf_core/float_inf_nan_converter.h libc/test/src/__support/FPUtil/fpbits_test.cpp libc/test/src/math/RoundToIntegerTest.h libc/test/src/math/atanhf_test.cpp libc/test/src/math/smoke/atanhf_test.cpp libc/test/src/stdlib/strtold_test.cpp libc/test/src/time/difftime_test.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/stdio/printf_core/float_dec_converter.h b/libc/src/stdio/printf_core/float_dec_converter.h
index e1a44234bb..6171d1d594 100644
--- a/libc/src/stdio/printf_core/float_dec_converter.h
+++ b/libc/src/stdio/printf_core/float_dec_converter.h
@@ -566,8 +566,7 @@ LIBC_INLINE int convert_float_decimal_typed(Writer *writer,
         const bool truncated = !zero_after_digits(
             exponent - FRACTION_LEN, precision,
             float_bits.get_explicit_mantissa(), FRACTION_LEN);
-        round =
-            get_round_direction(last_digit, truncated, float_bits.sign());
+        round = get_round_direction(last_digit, truncated, float_bits.sign());
 
         RET_IF_RESULT_NEGATIVE(
             float_writer.write_last_block(digits, maximum, round));

``````````

</details>


https://github.com/llvm/llvm-project/pull/78500


More information about the libc-commits mailing list