<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMeasurement/subtracting(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMeasurement(im)measurementBySubtractingMeasurement:"
  },
  "title" : "subtracting(_:)"
}
-->

# subtracting(_:)

Returns a new measurement by subtracting the specified measurement from the receiver.

```
func subtracting(_ measurement: Measurement<Unit>) -> Measurement<Unit>
```

## Parameters

`measurement`

The measurement to be subtracted.

## Return Value

A new measurement with a value equal to the receiver’s value minus the value of the specified measurement converted into the unit of the receiver.

## Discussion

This method raises an [`invalidArgumentException`](/documentation/Foundation/NSExceptionName/invalidArgumentException) if the receiver cannot be converted to unit.

You can use the [`canBeConverted(to:)`](/documentation/Foundation/NSMeasurement/canBeConverted(to:)) method, passing the unit of the specified measurement, to determine whether a measurement can be converted to a particular unit before calling this method.

---

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)