@@ -1904,8 +1904,10 @@ extension BinaryFloatingPoint {
19041904 if !value. isNaN {
19051905 let value_ = Float16 (
19061906 sign: value. sign,
1907- exponentBitPattern: UInt ( value. exponentBitPattern) ,
1908- significandBitPattern: UInt16 ( value. significandBitPattern) )
1907+ exponentBitPattern:
1908+ UInt ( truncatingIfNeeded: value. exponentBitPattern) ,
1909+ significandBitPattern:
1910+ UInt16 ( truncatingIfNeeded: value. significandBitPattern) )
19091911 self = Self ( Float ( value_) )
19101912 return
19111913 }
@@ -1915,8 +1917,10 @@ extension BinaryFloatingPoint {
19151917 if !value. isNaN {
19161918 let value_ = Float (
19171919 sign: value. sign,
1918- exponentBitPattern: UInt ( value. exponentBitPattern) ,
1919- significandBitPattern: UInt32 ( value. significandBitPattern) &<< 16 )
1920+ exponentBitPattern:
1921+ UInt ( truncatingIfNeeded: value. exponentBitPattern) ,
1922+ significandBitPattern:
1923+ UInt32 ( truncatingIfNeeded: value. significandBitPattern) &<< 16 )
19201924 self = Self ( value_)
19211925 return
19221926 }
@@ -1928,8 +1932,10 @@ extension BinaryFloatingPoint {
19281932 if !value. isNaN {
19291933 let value_ = Float (
19301934 sign: value. sign,
1931- exponentBitPattern: UInt ( value. exponentBitPattern) ,
1932- significandBitPattern: UInt32 ( value. significandBitPattern) )
1935+ exponentBitPattern:
1936+ UInt ( truncatingIfNeeded: value. exponentBitPattern) ,
1937+ significandBitPattern:
1938+ UInt32 ( truncatingIfNeeded: value. significandBitPattern) )
19331939 self = Self ( value_)
19341940 return
19351941 }
@@ -1941,8 +1947,10 @@ extension BinaryFloatingPoint {
19411947 if !value. isNaN {
19421948 let value_ = Double (
19431949 sign: value. sign,
1944- exponentBitPattern: UInt ( value. exponentBitPattern) ,
1945- significandBitPattern: UInt64 ( value. significandBitPattern) )
1950+ exponentBitPattern:
1951+ UInt ( truncatingIfNeeded: value. exponentBitPattern) ,
1952+ significandBitPattern:
1953+ UInt64 ( truncatingIfNeeded: value. significandBitPattern) )
19461954 self = Self ( value_)
19471955 return
19481956 }
@@ -1955,8 +1963,10 @@ extension BinaryFloatingPoint {
19551963 if !value. isNaN {
19561964 let value_ = Float80 (
19571965 sign: value. sign,
1958- exponentBitPattern: UInt ( value. exponentBitPattern) ,
1959- significandBitPattern: UInt64 ( value. significandBitPattern) )
1966+ exponentBitPattern:
1967+ UInt ( truncatingIfNeeded: value. exponentBitPattern) ,
1968+ significandBitPattern:
1969+ UInt64 ( truncatingIfNeeded: value. significandBitPattern) )
19601970 self = Self ( value_)
19611971 return
19621972 }
0 commit comments