Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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

  • π≈3.141592653589793\displaystyle \pi \approx 3.141592653589793
    numeric(pi)

    In the solver, numeric(pi) gives 3.141592653589793.

    Open in the solver
  • π≈3.1415926535897932385\displaystyle \pi \approx 3.1415926535897932385
    numeric(pi, digits = 20)

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

    Open in the solver
  • rationalize

    The simplest fraction equal to a decimal number.

  • chop

    A number with tiny parts replaced by zero.