---
title: "vDSP.ThresholdRule.signedConstant(_:)"
framework: accelerate
role: symbol
role_heading: Case
path: "accelerate/vdsp/thresholdrule/signedconstant(_:)"
---

# vDSP.ThresholdRule.signedConstant(_:)

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

## Declaration

```swift
case signedConstant(T)
```

## Discussion

Discussion Use vDSP.ThresholdRule.signedConstant(_:) to calculate a new vector where the threshold operation sets all source values below the threshold to the negated constant. let source: [Float] = [12, 13, 14, 15, 16, 17, 18]

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

// Prints "[-99.0, -99.0, -99.0, 99.0, 99.0, 99.0, 99.0]". print(destination)

## See Also

### Threshold rules

- [vDSP.ThresholdRule.clampToThreshold](accelerate/vdsp/thresholdrule/clamptothreshold.md)
- [vDSP.ThresholdRule.zeroFill](accelerate/vdsp/thresholdrule/zerofill.md)
