> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RINT

> Rounds a number to the nearest integer, resolving halfway values to the even integer.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL when an argument is NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
rint(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE or DECIMAL(p, s) | Yes | The number to round. For DECIMAL(p, s), p is precision (total digits) and s is scale (digits after the decimal point). |

## Returns

* Type: DOUBLE
* Possible values: A whole-valued DOUBLE for finite input; signed zero, NaN and infinities are preserved.
* NULL behavior: Returns NULL when an argument is NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | No |

* Approximation bound: No fixed maximum error is guaranteed.

## Usage notes

* Numeric input is converted to DOUBLE before rounding. DECIMAL values and large integers can lose precision during this conversion.
* INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
* Exact result: Floating-point computation can round the mathematical result.

## Examples

### Halfway values and NULL input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT rint(2.5) AS lower_even, rint(3.5) AS upper_even, rint(CAST(NULL AS DOUBLE)) AS null_value;
```

| lower\_even | upper\_even | null\_value |
| - | - | - |
| 2 | 4 | NULL |

### Negative half-way values

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT rint(CAST(-2.5 AS DOUBLE)) AS even_two, rint(CAST(-3.5 AS DOUBLE)) AS even_four;
```

| even\_two | even\_four |
| - | - |
| -2 | -4 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.