A quantum algorithm of finding the roots of a polynomial function f(x)=xm+am-1xm-1++a1x+a0 is discussed by using the generalized Bernstein-Vazirani algorithm. Our algorithm is presented in the modulo 2. Here all the roots are in the integers Z. The speed of solving the problem is shown to outperform the best classical case by a factor of m.