% Script File: Euler
%
% Sums the series 1 + 1/2 + 1/3 + .. in 3-digit floating point arithmetic.
% Terminates when the addition of the next term does not change
% the value of the running sum.

   clc
   oldsum = represent(0);
   one = represent(1);
   sum = one;
   k = 1;
   while convert(sum) ~= convert(oldsum)
      k = k+1;
      kay  = represent(k);
      term = float(one,kay,'/');
      oldsum = sum;
      sum  = float(sum,term,'+');
      home
      %disp(pretty(sum))
	  disp(['Sum through ' num2str(k) ' terms = ' pretty(sum)])	  
   end
   
  
