You are here:

- Home
- Computing/Technology
- C/C++
- C++
- horner's method

Advertisement

Hi

i have a project in c++,it is about horner's method,and the program should run it.

but i don't know what the program should want from user or do

could you plz just give me a suggestion about coding this program?

Thanx

Bita

Horner's method is a technique for evaluating polynomials.

It uses nested multiplication instead of exponentiation.

For example, the fourth-degree polynomial

P(x) = a4 * x^4 + a3 * x^3 + a2 * x^2 + a1 *x + a0

can be written in the 'nested multiplication' form

P(x) = ( ( ( ( a4 * x + a3 ) * x ) + a2 ) * x + a1 ) * x + a0

see: http://en.wikipedia.org/wiki/Horner_scheme

so your program should accept an nth-degree polynomial from the user and could do things like:

a. evaluate it for a particular value of x

b. find its roots

you would find other examples of using Horner algorithm (floating point division, radix conversion) in the wiki article.

- View Follow-Ups
- Add to this Answer
- Ask a Question

Rating(1-10) | Knowledgeability = 10 | Clarity of Response = 10 | Politeness = 10 |

Comment | No Comment |

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.

about 15 years or so**Education/Credentials**

post graduate engineer