Returns the distance from this value to the given value, expressed as a stride.
Required. Default implementation provided.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
func distance(to other: Self) -> Self.Stride
Parameters
otherThe value to calculate the distance to.
Return Value
The distance from this value to other.
Discussion
If this type’s Stride type conforms to Binary, then for two values x and y, and a distance n = x, x. Using this method with types that have a noninteger Stride may result in an approximation.
Complexity: O(1)