% Using three-digit chopping arithmetic to compute % "f(x) = exp(x)" at x = -5 x = -5; factorialn = 1; % n!, staring with 0! xn = 1; % x^n, starting with x^0 sum1 = 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 sum1 = chopk(sum1+term,3); end sum1