---
title: vDSP.ThresholdRule.zeroFill
framework: accelerate
role: symbol
role_heading: Case
path: accelerate/vdsp/thresholdrule/zerofill
---

# vDSP.ThresholdRule.zeroFill

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

## Declaration

```swift
case zeroFill
```

## Discussion

Discussion Use vDSP.ThresholdRule.zeroFill to calculate a new vector where the threshold operation sets all source values below the threshold to 0. 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)

## See Also

### Threshold rules

- [vDSP.ThresholdRule.clampToThreshold](accelerate/vdsp/thresholdrule/clamptothreshold.md)
- [vDSP.ThresholdRule.signedConstant(_:)](accelerate/vdsp/thresholdrule/signedconstant(_:).md)
