<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP_vlim",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_vlim"
  },
  "title" : "vDSP_vlim"
}
-->

# vDSP_vlim

Calculates the single-precision vector test limit using the specified stride.

```
extern void vDSP_vlim(const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N);
```

## Parameters

`__A`

Single-precision real input vector

`__IA`

Stride for `A`

`__B`

Pointer to single-precision real input scalar: limit

`__C`

Pointer to single-precision real input scalar

`__D`

Single-precision real output vector

`__ID`

Stride for `D`

`__N`

The number of elements to process

## Discussion

Compares values from vector `A` to limit scalar `*B`. For inputs greater than or equal to `*B`, scalar `*C` is written to `D` . For inputs  less than `*B`, the negated value of scalar `*C` is written to vector  `D`.

This calculates the following:

```objc
    for (n = 0; n < N; ++n)
        if (*B <= A[n*IA])
            D[n*ID] = *C;
        else
            D[n*ID] = -(*C);
```

---

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)