MATLAB uses floating-point arithmetic for its calculations.
Using the Symbolic Math Toolbox, we can also do exact arithmetic with symbolic expressions. For example:
The value of x is in floating-point format that is 6.1232^10-17.
However, we know that is equal to 0. This inaccuracy is due to the fact that typing pi in MATLAB gives an approximation to accurate to about 15 digits, not its exact value. To compute an exact value, we must type sym(pi/2).