# Rounding and Truncation Functions

#### <mark style="color:purple;">CEIL(</mark>  \<expr>  <mark style="color:purple;">)</mark>&#x20;

Returns the smallest integer which is greater than or equal to the specified numerical expression.

```sql
> select ceil(2.34);
3
```

#### <mark style="color:purple;">FLOOR(</mark>  \<expr>  <mark style="color:purple;">)</mark> &#x20;

Returns the largest integer which is less than or equal to the specified numerical expression.

```sql
> select floor(6.34);
6
```

#### <mark style="color:purple;">ROUND(</mark>  \<expr>  \[,  \<scale>  ]  <mark style="color:purple;">)</mark> &#x20;

Returns the numeric value, rounded off to a given number of decimal places, of the input numeric expression. If the scale factor is not specified, it will round off to the nearest integer.

`scale` - optional numeric expression, representing the number of decimal places to be rounded off to in a given numeric expression. Default is 0.

```sql
> select round(5.678);
6
> select round(5.678, 2);
5.68
```

#### <mark style="color:purple;">ABS(</mark>  \<expr>  <mark style="color:purple;">)</mark> &#x20;

Returns the absolute value of the specified numeric expression.

```sql
> select abs(-100);
100
```

#### <mark style="color:purple;">SIGN(</mark>  \<expr>  <mark style="color:purple;">)</mark> &#x20;

The SIGN function returns the sign of its argument:

* Returns -1 if the argument is negative
* Returns 1 if the argument is positive
* Returns 0 if the argument is 0

```sql
> select sign(-100);
-1
```

#### <mark style="color:purple;">MOD(</mark>  \<expr1>, \<expr2>  <mark style="color:purple;">)</mark> &#x20;

Returns the remainder of expression-1 divided by expression-2

Support datatype: INT/DOUBLE

```sql
> select mod(17,3)
2.0
```
