---
title: "ClikaRT::ops::round"
sidebar_label: "round"
description: "Elementwise rounding to decimals fractional digits. decimals = 0 (default) rounds to integers; positive keeps that many fractional digits; negative rounds to tens, hundreds, …."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## round() {#round}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`round`**([`Tensor`](../Tensor.md) `input`, `int64_t` `decimals` `=` `0`)

</div>

Elementwise rounding to `decimals` fractional digits.

`decimals = 0` (default) rounds to integers; positive keeps that many fractional digits; negative rounds to tens, hundreds, ….

**Parameters**

- `input`: the input tensor.
- `decimals`: how many fractional digits to keep. Default `0`.

**Throws**

- `ClikaRT::Error`: when the input's dtype is not served for this operation (the machine-readable reason rides `code_name()`).

**Returns:** a new tensor, same shape and dtype as `input`.

```cpp
auto y = ClikaRT::ops::round(x);       // integers
auto c = ClikaRT::ops::round(x, 2);    // cents
```

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 5259

</div>
