# Numerical approximation (numeric)

Approximate a number with decimals.

## How to write it

### numeric(expr)

The usual double-precision approximation.

**expr**

Any expression: a number, a formula, a list or a matrix. Takes an expression.

### numeric(expr, digits = n)

The approximation with the given number of digits.

**expr**

Any expression: a number, a formula, a list or a matrix. Takes an expression.

**digits = n**

How many digits to compute. Takes a whole number.

## Examples

- $\displaystyle \pi \approx 3.141592653589793$

  `numeric(pi)`

  In the solver, `numeric(pi)` gives `3.141592653589793`.

  [Open in the solver](https://hilberon.com/?q=numeric%28pi%29)
- $\displaystyle \pi \approx 3.1415926535897932385$

  `numeric(pi, digits = 20)`

  In the solver, `numeric(pi, digits = 20)` gives `3.1415926535897932385`.

  [Open in the solver](https://hilberon.com/?q=numeric%28pi%2C%20digits%20%3D%2020%29)

## Related functions

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

  The simplest fraction equal to a decimal number.
- [chop](https://hilberon.com/library/chop)

  A number with tiny parts replaced by zero.

---
Source: https://hilberon.com/library/numeric
