%  computes  n-th digit of a number x>0
function y=dig10(x,n)
u=abs(x);
u=floor(u./(10.^(n-1)));
y=mod(u,10);
