<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/simd/rint",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "simd"
    ],
    "preciseIdentifier" : "c:@macro@rint"
  },
  "title" : "rint"
}
-->

# rint

Returns each element in a vector rounded to the nearest integer in the specified direction.

```
#define rint(__x)
```

## Discussion

Use the `fesetround(_:)` function to specify the rounding direction. For example:

```objc
simd_float4 x;
x = simd_make_float4(1.2, 1.4, 1.6, 1.8);

fesetround(FE_DOWNWARD);
simd_float4 resultDownward = rint(x); // (1, 1, 1, 1)

fesetround(FE_UPWARD);
simd_float4 resultUpward = rint(x); // (2, 2, 2, 2)
    
fesetround(FE_TONEAREST);
simd_float4 resultNearest = rint(x); // (1, 1, 2, 2)
```

---

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)