Skip to content

Commit 378575c

Browse files
committed
Tweak formatting
1 parent e9bf7b3 commit 378575c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

zmij.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ constexpr auto floor_log2_pow10(int e) noexcept -> int {
338338
}
339339

340340
// 128-bit significands of powers of 10 rounded down.
341-
// Generated using 192-bit arithmetic method by Dougall Johnson.
341+
// Generation with 192-bit arithmetic and compression by Dougall Johnson.
342342
struct pow10_significands_table {
343343
static constexpr bool compress = ZMIJ_OPTIMIZE_SIZE != 0;
344344
static constexpr bool split_tables = !compress && ZMIJ_AARCH64 != 0;
@@ -404,12 +404,9 @@ struct pow10_significands_table {
404404
uint64_t c1 = h1 + h.hi * m;
405405
uint64_t c2 = (c1 < h1) + umul128_hi64(h.hi, m);
406406

407-
uint128 result;
408-
if (c2 >> 63)
409-
result = uint128{c2, c1};
410-
else
411-
result = uint128{(c2 << 1) | (c1 >> 63), (c1 << 1) | (c0 >> 63)};
412-
407+
uint128 result = (c2 >> 63) != 0
408+
? uint128{c2, c1}
409+
: uint128{c2 << 1 | c1 >> 63, c1 << 1 | c0 >> 63};
413410
result.lo -= (fixups[i >> 5] >> (i & 31)) & 1;
414411
return result;
415412
}

0 commit comments

Comments
 (0)