<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/ThresholdRule/zeroFill",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO13ThresholdRuleO8zeroFillyAEy_xGAGmSBRzlF"
  },
  "title" : "vDSP.ThresholdRule.zeroFill"
}
-->

# vDSP.ThresholdRule.zeroFill

Returns `0` if the input value is less than the threshold; otherwise returns the input value.

```
case zeroFill
```

## Discussion

Use [`vDSP.ThresholdRule.zeroFill`](/documentation/Accelerate/vDSP/ThresholdRule/zeroFill) to calculate a new vector where the threshold operation sets all source values below the threshold to `0`.

```swift
let source: [Float] = [12, 13, 14, 15, 16, 17, 18]

let destination = vDSP.threshold(source,
                                 to: 15,
                                 with: .zeroFill)

// Prints "[0.0, 0.0, 0.0, 15.0, 16.0, 17.0, 18.0]]"
print(destination)
```

---

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)