<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/SignedNumeric",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s13SignedNumericP"
  },
  "title" : "SignedNumeric"
}
-->

# SignedNumeric

A numeric type with a negation operation.

```
protocol SignedNumeric : Numeric
```

## Overview

The `SignedNumeric` protocol extends the operations defined by the
`Numeric` protocol to include a value’s additive inverse.

# Conforming to the SignedNumeric Protocol

Because the `SignedNumeric` protocol provides default implementations of
both of its required methods, you don’t need to do anything beyond
declaring conformance to the protocol and ensuring that the values of your
type support negation. To customize your type’s implementation, provide
your own mutating `negate()` method.

When the additive inverse of a value is unrepresentable in a conforming
type, the operation should either trap or return an exceptional value. For
example, using the negation operator (prefix `-`) with `Int.min` results in
a runtime error.

```
let x = Int.min
let y = -x
// Overflow error
```

---

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)