---
title: "trunc(_:)"
framework: simd
role: symbol
role_heading: Function
path: "simd/trunc(_:)-1xvcu"
---

# trunc(_:)

Returns each element in a vector rounded toward zero to the nearest integer.

## Declaration

```swift
func trunc(_ x: SIMD2<Double>) -> SIMD2<Double>
```

## See Also

### Math Functions

- [cbrt(_:)](simd/cbrt(_:)-75bqn.md)
- [ceil(_:)](simd/ceil(_:)-cu6z.md)
- [erf(_:)](simd/erf(_:)-7tfrz.md)
- [erfc(_:)](simd/erfc(_:)-8i2r6.md)
- [floor(_:)](simd/floor(_:)-21h1y.md)
- [fma(_:_:_:)](simd/fma(_:_:_:)-4fxau.md)
- [fmod(_:_:)](simd/fmod(_:_:)-81hr1.md)
- [hypot(_:_:)](simd/hypot(_:_:)-9ecpz.md)
- [lgamma(_:)](simd/lgamma(_:)-697vf.md)
- [nextafter(_:_:)](simd/nextafter(_:_:)-6qeuz.md)
- [pow(_:_:)](simd/pow(_:_:)-2ov0n.md)
- [remainder(_:_:)](simd/remainder(_:_:)-1l80m.md)
- [round(_:)](simd/round(_:)-1ith.md)
- [simd_muladd(_:_:_:)](simd/simd_muladd(_:_:_:)-o9lv.md)
- [tgamma(_:)](simd/tgamma(_:)-3id8t.md)
