File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,11 @@ extension BigUInt {
49
49
guard integer. sign == . plus else { return nil }
50
50
assert ( integer. floatingPointClass == . positiveNormal)
51
51
52
- // keeping around in case the `Decimal._mantissa` property gets deprecated in the future.
53
- // let significand = BigUInt("\(integer.significand)")!
52
+ #if os(Linux)
53
+ // `Decimal._mantissa` has an internal access level on linux, and it might get
54
+ // deprecated in the future, so keeping the string implementation around for now.
55
+ let significand = BigUInt ( " \( integer. significand) " ) !
56
+ #else
54
57
let significand = {
55
58
var start = BigUInt ( 0 )
56
59
for (place, value) in integer. significand. mantissaParts. enumerated ( ) {
@@ -59,6 +62,7 @@ extension BigUInt {
59
62
}
60
63
return start
61
64
} ( )
65
+ #endif
62
66
let exponent = BigUInt ( 10 ) . power ( integer. exponent)
63
67
64
68
self = significand * exponent
@@ -134,7 +138,7 @@ extension BigInt.Sign {
134
138
}
135
139
}
136
140
137
- #if canImport(Foundation)
141
+ #if canImport(Foundation) && !os(Linux)
138
142
private extension Decimal {
139
143
var mantissaParts : [ UInt16 ] {
140
144
[
You can’t perform that action at this time.
0 commit comments