Hi,
I need to write C++ code to find the factors of a polynomial.For eg. X^2-1 should return x-1 and x+1...anyone have any ideas on how to do this?
I'm actually implementing something similar to a CRC..I need to use one of the factors to divide a message and get the remainder...any help with this is appreciated
Write yourself an expression parser which handles polynomials, then apply a numerical method such as the newton raphson to find the roots of the equation.
expression parser that handles polynomials?
Yep, then end result being something like:
I've started to work on such a beast but never got around to putting the whole thing together
http://www.daniweb.com/code/snippet599.html
http://www.daniweb.com/code/snippet891.html
Why not try this site : http://www.factoring-polynomials.com/ See how it's done and translate that to C++.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.