---
title: "subtracting(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmeasurement/subtracting(_:)"
---

# subtracting(_:)

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

## Declaration

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

## Parameters

- `measurement`: The measurement to be subtracted.

## Return Value

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

Discussion This method raises an invalidArgumentException if the receiver cannot be converted to unit. You can use the 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.

## See Also

### Operating on Measurements

- [adding(_:)](foundation/nsmeasurement/adding(_:).md)
