We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b62328b commit 42f79b0Copy full SHA for 42f79b0
stdlib/public/core/FloatingPoint.swift
@@ -1890,7 +1890,18 @@ extension BinaryFloatingPoint {
1890
/// - Parameter value: A floating-point value to be converted.
1891
@inlinable
1892
public init<Source: BinaryFloatingPoint>(_ value: Source) {
1893
- self = Self._convert(from: value).value
+ switch value {
1894
+ case let value_ as Float:
1895
+ self = Self(value_)
1896
+ case let value_ as Double:
1897
1898
+#if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
1899
+ case let value_ as Float80:
1900
1901
+#endif
1902
+ default:
1903
+ self = Self._convert(from: value).value
1904
+ }
1905
}
1906
1907
/// Creates a new instance from the given value, if it can be represented
0 commit comments