---
title: vDSP_vsubD
framework: Accelerate
role: symbol
role_heading: Function
platforms: [iOS 4.0+, iPadOS 4.0+, Mac Catalyst 13.1+, macOS 10.2+, visionOS 1.0+, watchOS 2.0+]
path: accelerate/vdsp_vsubd
---

# vDSP_vsubD

Calculates the double-precision element-wise subtraction of two vectors, using the specified stride.

## Declaration

```occ
extern void vDSP_vsubD(const double *__B, vDSP_Stride __IB, const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N);
```

## Parameters

- `__B`: The first input vector, B.
- `__IB`: The distance between the elements in the first input vector.
- `__A`: The second input vector, A.
- `__IA`: The distance between the elements in the second input vector.
- `__C`: The output vector, C.
- `__IC`: The distance between the elements in the output vector.
- `__N`: The number of elements that the function processes.

## Discussion

Discussion This function calculates the differences of the first N elements of input vectors A and B, and writes the result to output vector C, as follows:  for (n = 0; n < N; ++n)     C[n] = A[n] - B[n];

The following code shows an example of using this function:

## See Also

### Binary subtraction operations

- [vDSP_vsub](accelerate/vdsp_vsub.md)
