# 四舍五入（Rounding，round）

最接近的整数，恰为半时向远离零的方向舍入。

## 怎么写

### round(x)

**x**

一个数。接受一个数。

## 示例

- $\displaystyle \operatorname{round}(2.4) = 2$

  `round(2.4)`

  在求解器中，`round(2.4)` 的结果是 `2`。

  [在求解器中打开](https://zh.hilberon.com/?q=round%282.4%29)
- $\displaystyle \operatorname{round}(-2.5) = -3$

  `round(-2.5)`

  在求解器中，`round(-2.5)` 的结果是 `-3`。

  [在求解器中打开](https://zh.hilberon.com/?q=round%28-2.5%29)

## 相关函数

- [sign](https://zh.hilberon.com/library/sign)

  数的符号：-1、0 或 1。
- [re](https://zh.hilberon.com/library/re)

  复数的实部。
- [sqrt](https://zh.hilberon.com/library/sqrt)

  平方根；sqrt(x) 即幂 x^(1/2)。
- [quotient](https://zh.hilberon.com/library/quotient)

  除法的整数商，不含余数。
- [subtract](https://zh.hilberon.com/library/subtract)

  差：- 的函数形式。
- [power](https://zh.hilberon.com/library/power)

  幂：^ 的函数形式。

---
Source: https://zh.hilberon.com/library/round
