<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/numeric-protocols",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Numeric Protocols"
}
-->

# Numeric Protocols

Write generic code that works with any numeric type.

## Topics

### Basic Arithmetic

[`AdditiveArithmetic`](/documentation/Swift/AdditiveArithmetic)

A type with values that support addition and subtraction.

[`Numeric`](/documentation/Swift/Numeric)

A type with values that support multiplication.

[`SignedNumeric`](/documentation/Swift/SignedNumeric)

A numeric type with a negation operation.

[`Strideable`](/documentation/Swift/Strideable)

A type representing continuous, one-dimensional values that can be offset
and measured.

### Integer

[`BinaryInteger`](/documentation/Swift/BinaryInteger)

An integer type with a binary representation.

[`FixedWidthInteger`](/documentation/Swift/FixedWidthInteger)

An integer type that uses a fixed size for every instance.

[`SignedInteger`](/documentation/Swift/SignedInteger)

An integer type that can represent both positive and negative values.

[`UnsignedInteger`](/documentation/Swift/UnsignedInteger)

An integer type that can represent only nonnegative values.

### Floating Point

[`FloatingPoint`](/documentation/Swift/FloatingPoint)

A floating-point numeric type.

[`BinaryFloatingPoint`](/documentation/Swift/BinaryFloatingPoint)

A radix-2 (binary) floating-point type.

### Floating-Point Characteristics

[`FloatingPointClassification`](/documentation/Swift/FloatingPointClassification)

The IEEE 754 floating-point classes.

[`FloatingPointRoundingRule`](/documentation/Swift/FloatingPointRoundingRule)

A rule for rounding a floating-point number.

[`FloatingPointSign`](/documentation/Swift/FloatingPointSign)

The sign of a floating-point value.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)