@@ -264,7 +264,7 @@ internal func _Float16ToASCII(
264
264
nextDigit &+= 1
265
265
}
266
266
}
267
- let digit = 0x30 &+ ( t &+ ( 1 & << 27 ) ) >> 28
267
+ let digit = 0x30 &+ ( t &+ ( 1 << 27 ) ) >> 28
268
268
unsafe buffer. storeBytes (
269
269
of: UInt8 ( truncatingIfNeeded: digit) ,
270
270
toUncheckedByteOffset: nextDigit,
@@ -606,7 +606,7 @@ internal func _Float32ToASCII(
606
606
607
607
// Adjust the final digit to be closer to the original value
608
608
let isBoundary = ( f. significandBitPattern == 0 )
609
- if delta > t &+ ( 1 & << fractionBits) {
609
+ if delta > t &+ ( 1 << fractionBits) {
610
610
let skew : UInt64
611
611
if isBoundary {
612
612
skew = delta &- delta / 3 &- t
@@ -698,15 +698,15 @@ internal func _Float64ToASCII(
698
698
//
699
699
let binaryExponent : Int
700
700
let significand : Double . RawSignificand
701
- let exponentBias = ( 1 << ( Double . exponentBitCount - 1 ) ) - 2 // 1022
701
+ let exponentBias = 1022 // (1 << (Double.exponentBitCount - 1)) - 2
702
702
703
703
if ( d. exponentBitPattern == 0x7ff ) {
704
704
if ( d. isInfinite) {
705
705
return _infinity ( buffer: & buffer, sign: d. sign)
706
706
} else { // d.isNaN
707
707
let quietBit =
708
708
( d. significandBitPattern >> ( Double . significandBitCount - 1 ) ) & 1
709
- let payloadMask = ( UInt64 ( 1 ) << ( Double . significandBitCount - 2 ) ) - 1
709
+ let payloadMask = ( UInt64 ( 1 ) & << ( Double . significandBitCount - 2 ) ) - 1
710
710
let payload64 = d. significandBitPattern & payloadMask
711
711
return nan_details (
712
712
buffer: & buffer,
@@ -1649,9 +1649,9 @@ fileprivate func _finishFormatting(
1649
1649
let zeroEnd = firstDigit &+ base10Exponent &+ 3
1650
1650
// TODO: Find out how to use C memset() here:
1651
1651
// Blast 8 "0" digits into the buffer
1652
- unsafe buffer. storeBytes (
1652
+ buffer. storeBytes (
1653
1653
of: 0x3030303030303030 as UInt64 ,
1654
- toUncheckedByteOffset : nextDigit,
1654
+ toByteOffset : nextDigit,
1655
1655
as: UInt64 . self)
1656
1656
// Add more "0" digits if needed...
1657
1657
// (Note: Can't use a standard range loop because nextDigit+8
0 commit comments