# Numeric evaluation: evalf

### 5.59.6 Numeric evaluation: evalf

The evalf command finds floating point approximations to the numbers in an expression or a matrix (see also Section 5.8.1).

- evalf takes one mandatory and one optional argument:
  - expr, an expression or a matrix.
  - Optionally, n, a positive integer representing the significant digits (by default DIGITS, which itself has a default value of 12; see Section 2.5.1).
- evalf(expr ⟨ n ⟩) returns expr with all the numbers replaced by floating point approximations to n digits.

#### Examples.

- Input:
  evalf(sqrt(2))
  Output:

  1.41421356237

- Input:
  evalf(sqrt(2),20)
  Output:

  1.4142135623730950488

- Input:
  evalf([[1,sqrt(2)],[0,1]])
  Output:

  ⎡
  ⎢
  ⎣

  1.0 | 1.41421356237
  0.0 | 1.0

  ⎤
  ⎥
  ⎦