Write generic code that works with any numeric type.
Numeric Protocols
Topics
Basic Arithmetic
protocol Additive ArithmeticA type with values that support addition and subtraction.
protocol NumericA type with values that support multiplication.
protocol Signed NumericA type that can represent both positive and negative values.
protocol StrideableA type representing continuous, one-dimensional values that can be offset and measured.
Integer
protocol Binary IntegerAn integer type with a binary representation.
protocol Fixed Width IntegerAn integer type that uses a fixed size for every instance.
protocol Signed IntegerAn integer type that can represent both positive and negative values.
protocol Unsigned IntegerAn integer type that can represent only nonnegative values.
Floating Point
protocol Floating PointA floating-point numeric type.
protocol Binary Floating PointA 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.