Skip to content

Commit d38304e

Browse files
committed
Build and format fixes
1 parent 516c28c commit d38304e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

libc/src/__support/FPUtil/dyadic_float.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,19 @@ template <size_t Bits>
4242
LIBC_INLINE constexpr int
4343
rounding_direction(const LIBC_NAMESPACE::UInt<Bits> &value, size_t rshift,
4444
Sign logical_sign) {
45-
if (rshift == 0 ||
46-
(rshift < Bits && (value << (Bits - rshift)) == 0) ||
45+
if (rshift == 0 || (rshift < Bits && (value << (Bits - rshift)) == 0) ||
4746
(rshift >= Bits && value == 0))
48-
return 0; // exact
47+
return 0; // exact
4948

5049
switch (quick_get_round()) {
5150
case FE_TONEAREST:
5251
if (rshift > 0 && rshift <= Bits && value.get_bit(rshift - 1)) {
5352
// We round up, unless the value is an exact halfway case and
5453
// the bit that will end up in the units place is 0, in which
5554
// case tie-break-to-even says round down.
56-
return value.get_bit(rshift) != 0 || (value << (Bits - rshift + 1)) != 0 ? +1 : -1;
55+
return value.get_bit(rshift) != 0 || (value << (Bits - rshift + 1)) != 0
56+
? +1
57+
: -1;
5758
} else {
5859
return -1;
5960
}
@@ -440,16 +441,14 @@ template <size_t Bits> struct DyadicFloat {
440441

441442
LIBC_INLINE constexpr MantissaType
442443
as_mantissa_type_rounded(int *round_dir_out = nullptr) const {
443-
int round_dir;
444+
int round_dir = 0;
444445
MantissaType new_mant;
445446
if (mantissa.is_zero()) {
446-
round_dir = 0;
447447
new_mant = 0;
448448
} else {
449449
new_mant = mantissa;
450450
if (exponent > 0) {
451451
new_mant <<= exponent;
452-
round_dir = 0;
453452
} else if (exponent < 0) {
454453
size_t shift = -exponent;
455454
new_mant >>= shift;

0 commit comments

Comments
 (0)