Finding the root of a polynomial

This is a discussion on Finding the root of a polynomial within the C Programming forums, part of the General Programming Boards category; I can find the root of a polinomial in a segment [A,B]. I can find it if root == A, ...

Then f(A) = 1 and f(B) = 1. However, even though they have the same sign, there are two roots in the domain, sqrt(3) and -sqrt(3). If you are limited to just linear functions, your algorithm is fine, but I don't think there's any foolproof way for a general polynomial (although there is a way for 2nd order, and maybe some higher orders). You can make it better by checking many points for sign changes, though, instead of just two.