function eapprox = esum(tol)
%Approximation to e to a given tolerance
eapprox = 1;
term = eapprox;
n = 1;
while (abs(term) >= tol)
    term = term/n;
    eapprox = eapprox + term;
    n = n + 1;
end 
% n-1
end

