function y = chop(x,n); if (x==0), y=0; else y = sign(x) * round(abs(x)/10^(floor(log10(abs(x))-n+1))) * ... 10^(floor(log10(abs(x)))-n+1); end;