@@ -1035,10 +1035,10 @@ public func NSDecimalNormalize(_ a: UnsafeMutablePointer<Decimal>, _ b: UnsafeMu
1035
1035
//
1036
1036
// Divide bb by this value
1037
1037
//
1038
- _ = integerMultiplyByPowerOf10 ( & result, bb. pointee, maxpow10 - diffexp)
1038
+ _ = integerMultiplyByPowerOf10 ( & result, bb. pointee, Int ( maxpow10 - diffexp) )
1039
1039
1040
1040
bb. pointee. copyMantissa ( from: result)
1041
- bb. pointee. _exponent -= maxpow10 - diffexp;
1041
+ bb. pointee. _exponent -= Int32 ( maxpow10 - diffexp) ;
1042
1042
1043
1043
//
1044
1044
// If bb > 0 multiply aa by the same value
@@ -1336,7 +1336,7 @@ public func NSDecimalDivide(_ result: UnsafeMutablePointer<Decimal>, _ leftOpera
1336
1336
* accurate result later. I chose 19 arbitrarily
1337
1337
* as half of the magic 38, so that normalization
1338
1338
* doesn't always occur. */
1339
- if ( 19 <= a. _exponent - b. _exponent) {
1339
+ if ( 19 <= Int ( a. _exponent - b. _exponent) ) {
1340
1340
_ = NSDecimalNormalize ( & a, & b, roundingMode) ;
1341
1341
/* We ignore the small loss of precision this may
1342
1342
* induce in the individual operands. */
@@ -1615,7 +1615,7 @@ extension Decimal {
1615
1615
}
1616
1616
fileprivate mutating func round( scale: Int , roundingMode: RoundingMode ) {
1617
1617
// scale is the number of digits after the decimal point
1618
- var s = scale + _exponent
1618
+ var s = Int32 ( scale) + _exponent
1619
1619
if s == NSDecimalNoScale || s >= 0 {
1620
1620
return
1621
1621
}
@@ -2025,7 +2025,7 @@ extension Scanner {
2025
2025
if numeral == - 1 {
2026
2026
break
2027
2027
}
2028
- exponent = 10 * exponent + numeral
2028
+ exponent = 10 * exponent + Int32 ( numeral)
2029
2029
guard exponent <= 2 * Int32( Int8 . max) else {
2030
2030
return Decimal . nan
2031
2031
}
0 commit comments