[libc-commits] [PATCH] D118791: [libc][Obvious] Fix a mismatch signature of HighPrecisionDecimal::should_round_up.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Feb 3 14:36:59 PST 2022


sivachandra added a comment.

In D118791#3295156 <https://reviews.llvm.org/D118791#3295156>, @michaelrj wrote:

> My reason is that `roundToDigit` can be negative, and changing it to be unsigned would break that. The only line where `should_round_up` is called is line 367, and it's passed `decimal_point`, which is a signed integer which may sometimes be negative.

As I read it, this change is making `roudnToDigit` to be of a signed type instead of an unsigned type. It is switching the type of `roundToDigit` from `uint32_t` (unsigned 32-bit integer) to `int32_t` (signed 32-bit integer).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118791/new/

https://reviews.llvm.org/D118791



More information about the libc-commits mailing list