Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

20.3 Example Program: Roots of a Polynomial


NOTE: This program is in the file complx.cpp .

The roots of a polynomial a x2 + b x + c = 0 are given by the formula:

x = (-b 2 - 4ac))/2a

The following program takes as input three double precision numbers, and returns the complex roots as a pair of values.



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998