% Using three-digit chopping arithmetic to compute % "f(x) = exp(x)" at x = -5 x = 5; factorialn = 1; %n!, stating with 0! xn = 1; %x^n, starting with x^0 sum2 = 1; for n = 1:9 factorialn = chopk(factorialn*chopk(n,3),3); % compute n! in the loop xn = chopk(xn*chopk(x,3),3); % compute x^n in the loop term = chopk(xn/factorialn,3); % compute n-th term sum2 = chopk(sum2+term,3); % compute the sum end sum2 = chopk(1/sum2,3)