[libc][Obvious] Fix a mismatch signature of HighPrecisionDecimal::should_round_up.
authorTue Ly <lntue@google.com>
Wed, 2 Feb 2022 15:18:28 +0000 (10:18 -0500)
committerTue Ly <lntue@google.com>
Fri, 4 Feb 2022 03:36:03 +0000 (22:36 -0500)
Its input should be int32_t instead of uint32_t.

Reviewed By: michaelrj, sivachandra

Differential Revision: https://reviews.llvm.org/D118791

libc/src/__support/high_precision_decimal.h

index 00ccd70..1b941da 100644 (file)
@@ -111,7 +111,7 @@ class HighPrecisionDecimal {
   uint8_t digits[MAX_NUM_DIGITS];
 
 private:
-  bool should_round_up(uint32_t roundToDigit) {
+  bool should_round_up(int32_t roundToDigit) {
     if (roundToDigit < 0 || roundToDigit >= this->num_digits) {
       return false;
     }