<!--
{
  "documentType" : "article",
  "framework" : "AppStoreConnectAPI",
  "identifier" : "/documentation/AppStoreConnectAPI/subtracting-numbers",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Subtracting numbers"
}
-->

# Subtracting numbers

Return the result of subtracting two numbers.

## Discussion

Use the `sub()` function in the expression of a matchmaking rule to subtract two numbers.

### Declaration

```other
number sub(number $minuend, number $subtrahend)
```

### Parameters

-`minuend`: The left side of the subtraction equation.
-`subtrahend`: The right side of the subtraction equation.

### Return value

The result of subtracting `subtrahend` from `minuend`. If either parameter isn’t a number, `null`.

---

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)