@@ -1904,8 +1904,10 @@ extension BinaryFloatingPoint {
1904
1904
if !value. isNaN {
1905
1905
let value_ = Float16 (
1906
1906
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) )
1909
1911
self = Self ( Float ( value_) )
1910
1912
return
1911
1913
}
@@ -1915,8 +1917,10 @@ extension BinaryFloatingPoint {
1915
1917
if !value. isNaN {
1916
1918
let value_ = Float (
1917
1919
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 )
1920
1924
self = Self ( value_)
1921
1925
return
1922
1926
}
@@ -1928,8 +1932,10 @@ extension BinaryFloatingPoint {
1928
1932
if !value. isNaN {
1929
1933
let value_ = Float (
1930
1934
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) )
1933
1939
self = Self ( value_)
1934
1940
return
1935
1941
}
@@ -1941,8 +1947,10 @@ extension BinaryFloatingPoint {
1941
1947
if !value. isNaN {
1942
1948
let value_ = Double (
1943
1949
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) )
1946
1954
self = Self ( value_)
1947
1955
return
1948
1956
}
@@ -1955,8 +1963,10 @@ extension BinaryFloatingPoint {
1955
1963
if !value. isNaN {
1956
1964
let value_ = Float80 (
1957
1965
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) )
1960
1970
self = Self ( value_)
1961
1971
return
1962
1972
}
0 commit comments