Conforming types are notionally continuous, one-dimensional values that can be offset and measured.


Comparing Values

func distance(to: Self)

Returns a stride x such that self.advanced(by: x) approximates other.

Required. Default implementation provided.

Creating a Range

static func ...(Self)

Returns a countable partial range extending upward from a lower bound.


Operator Functions

See Also

Basic Arithmetic

protocol Numeric

Declares methods backing binary arithmetic operators–such as +, - and *–and their mutating counterparts.

protocol SignedNumeric

A type that can represent both positive and negative values.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software