File tree Expand file tree Collapse file tree 1 file changed +10
-23
lines changed Expand file tree Collapse file tree 1 file changed +10
-23
lines changed Original file line number Diff line number Diff line change @@ -205,29 +205,16 @@ extension Decimal : Hashable, Comparable {
205
205
if _length == 0 && _isNegative == 1 {
206
206
return Double . nan
207
207
}
208
- for i in 0 ..< 8 {
209
- let index = 8 - i - 1
210
- switch index {
211
- case 0 :
212
- d = d * 65536 + Double( _mantissa. 0 )
213
- case 1 :
214
- d = d * 65536 + Double( _mantissa. 1 )
215
- case 2 :
216
- d = d * 65536 + Double( _mantissa. 2 )
217
- case 3 :
218
- d = d * 65536 + Double( _mantissa. 3 )
219
- case 4 :
220
- d = d * 65536 + Double( _mantissa. 4 )
221
- case 5 :
222
- d = d * 65536 + Double( _mantissa. 5 )
223
- case 6 :
224
- d = d * 65536 + Double( _mantissa. 6 )
225
- case 7 :
226
- d = d * 65536 + Double( _mantissa. 7 )
227
- default :
228
- fatalError ( " conversion overflow " )
229
- }
230
- }
208
+
209
+ d = d * 65536 + Double( _mantissa. 7 )
210
+ d = d * 65536 + Double( _mantissa. 6 )
211
+ d = d * 65536 + Double( _mantissa. 5 )
212
+ d = d * 65536 + Double( _mantissa. 4 )
213
+ d = d * 65536 + Double( _mantissa. 3 )
214
+ d = d * 65536 + Double( _mantissa. 2 )
215
+ d = d * 65536 + Double( _mantissa. 1 )
216
+ d = d * 65536 + Double( _mantissa. 0 )
217
+
231
218
if _exponent < 0 {
232
219
for _ in _exponent..< 0 {
233
220
d /= 10.0
You can’t perform that action at this time.
0 commit comments