Write generic code that works with any numeric type.
Numeric Protocols
Topics
Basic Arithmetic
protocol Additive Arithmetic
A type with values that support addition and subtraction.
protocol Numeric
A type with values that support multiplication.
protocol Signed Numeric
A type that can represent both positive and negative values.
protocol Strideable
A type representing continuous, one-dimensional values that can be offset and measured.
Integer
protocol Binary Integer
An integer type with a binary representation.
protocol Fixed Width Integer
An integer type that uses a fixed size for every instance.
protocol Signed Integer
An integer type that can represent both positive and negative values.
protocol Unsigned Integer
An integer type that can represent only nonnegative values.
Floating Point
protocol Floating Point
A floating-point numeric type.
protocol Binary Floating Point
A radix-2 (binary) floating-point type.
See Also
Advanced Numerics
Work with fixed-width numeric types of different sizes.
Work with fixed-width vectors of fixed-width numeric types of different sizes.
Use these functions with numeric values and other comparable types.