echo on

% Problem 1

clear
close all

% a)

3+9

% b)

2^123

% This is a floating point approximation to 2^123.  We can force all
% of the digits of this integer to be displayed by converting one of
% the numbers to a symbolic expression.

sym('2')^123

% c)

% We use vpa to display 35 digits of pi^2.

vpa('pi^2', 35)

% Unlike pi, e is not predefined in MATLAB, but we can generate it by
% taking the exponential of 1.

vpa('exp(1)', 35)

% d)

a = 22/7
b = 311/99
c = 355/113

a - pi
b - pi
c - pi

% We see that 355/113 is the best approxinmation to pi.

echo off