%
% function dec = accuracy( mat)
%
%  function to estimate the accuracy in decimal points 
%  that is needed to represent a matrix MAT
%
%

%
% Copyright © 19-Oct-2007 George P. Pavlidis® (sepdek@sepdek.net, gpavlid@ceti.gr)
%
function dec = accuracy( mat)

	dec=0;
	if numel( mat) > 1,
		while sum( mat(:) > fix( mat(:))) > realmin,
			mat = mat*10;
			dec = dec+1;
		end;
	else
		while abs(mat-fix( mat)) > realmin,
			mat = mat*10;
			dec = dec+1;
		end;
	end;