function s = Dot3(x,y) % x = Dot3(x,y) % x and y are column vectors of the same length. s is their % dot product, computed as though MATLAB's internal Representation % was three-digit base-10 floating point. % accumulator acc = Represent(0); % just a little error checking len = min(length(x), length(y)); for k=1:len acc = Float(acc, ... Float(Represent(x(k)), Represent(y(k)), '*'), ... '+'); end s = Convert(acc);