### 9.4.6 Numeric evaluation

The evalf command finds floating point approximations to the numbers in an expression or a matrix (see also Section 7.3.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

evalf(sqrt(2))

1.41421356237 |  |  |  |  |  |  |  |  |  |

evalf(sqrt(2),20)

1.4142135623730950488 |  |  |  |  |  |  |  |  |  |

evalf([[1,sqrt(2)],[0,1]])

⎡
⎢
⎣

1.0 | 1.41421356237
0.0 | 1.0

⎤
⎥
⎦