function tangent_method(f,df,x_0,number_of_digits)
epsilon=10^(-number_of_digits);
i=0;
x=x_0;
while i<100
    d=-f(x)/df(x);
    x=x+d
    if f(x)~=0
     i=i+1;
    else
        disp(x)
        break
    end
    if ~(abs(d)>epsilon)
        fprintf('iterations %d\n\n', i);
        fprintf('result is %0.5f',round(x,number_of_digits))
        break
    end
end