ICU-13725 Responding to small code review comments.

X-SVN-Rev: 41283
This commit is contained in:
Shane Carr 2018-04-27 08:02:40 +00:00
parent c13e7785c2
commit d5253cfcae
2 changed files with 3 additions and 3 deletions

View file

@ -511,7 +511,7 @@ int64_t DecimalQuantity::toLong(bool truncateIfOverflow) const {
result = result * 10 + getDigitPos(magnitude - scale);
}
if (isNegative()) {
return static_cast<int64_t>(~result + 1); // i.e., -result
return static_cast<int64_t>(0LL - result); // i.e., -result
}
return static_cast<int64_t>(result);
}

View file

@ -1,8 +1,6 @@
// © 2018 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
#include <stdlib.h>
#include <cmath>
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
@ -11,6 +9,8 @@
// Helpful in toString methods and elsewhere.
#define UNISTR_FROM_STRING_EXPLICIT
#include <stdlib.h>
#include <cmath>
#include "number_types.h"
#include "number_utils.h"
#include "charstr.h"