<!--
{
  "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_viclip",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_viclip"
  },
  "title" : "vDSP_viclip"
}
-->

# vDSP_viclip

Calculates the elements of a single-precision vector inverted-clipped to the specified range using the specified stride.

```
extern void vDSP_viclip(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: lower threshold

`__C`

Pointer to single-precision real input scalar: upper threshold

`__D`

Single-precision real output vector

`__ID`

Stride for `D`

`__N`

The number of elements to process

## Discussion

Performs the following operation:

```objc
for (int n = 0; n < N; ++n) {
    if (A[nIA] <= *B || A[nIA] >= *C)
        D[nID] = A[nIA];
    else if (A[nIA] < 0)
        D[nID] = *B;
    else
        D[nID] = *C;
 
}
```

Performs an inverted clip of vector `A` using lower-threshold and  upper-threshold input scalars `*B` and `*C`. Note that negative values in `A` are clipped to `*B`.

---

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)