Merge pull request #7870 from stephentyrone/FloatingPoint-Hashable
FloatingPoint should imply Hashable.
`Hashable` is related to `Equatable`, and `FloatingPoint` is `Equatable`, with enough additional constraints that `Hashable` conformance is practical.
There's *almost* no excuse for any `Equatable` thing not to also be `Hashable`; the exception is when the underlying representation may be denormalized in some way that makes it impossible or expensive to normalize (e.g. `Set`). Floating point numbers have denormalized forms, so this comes down to the cost of normalization. Since we can't imagine a representation whose normalization is much more expensive than the subsequent hashing step, the conformance belongs.
diff --git a/stdlib/public/core/FloatingPoint.swift.gyb b/stdlib/public/core/FloatingPoint.swift.gyb
index 2e61719..d6e9a07 100644
--- a/stdlib/public/core/FloatingPoint.swift.gyb
+++ b/stdlib/public/core/FloatingPoint.swift.gyb
@@ -168,7 +168,7 @@
/// "out of \(tempsFahrenheit.count) observations.")
/// // Prints "Average: 74.84°F in 5 out of 7 observations."
public protocol FloatingPoint: Comparable, Arithmetic,
- SignedNumber, Strideable {
+ SignedNumber, Strideable, Hashable {
/// A type that represents any written exponent.
associatedtype Exponent: SignedInteger