don't tell me that you don't find the way to implement the secant-method or bisection method!
You have only to implement the algorithm:
ask for a function f(x) and for the borders x1 and x2.
check that sign(f(x1)) != sign(f(x2)) .
Then compute x3 inside the interval (x1, x2). This according on the algorithm, in bisection case x3=(x1+x2)/2,....in secant method it's only the point where the line from (x1,f(x1)) to (x2,f(x2)) intercept the x-axe.
then choose the new interval (or x1-x3 or x3-x2) according on where is the root.
Then start again on the new interval.
Do this 10000...000 times and stop it. Or stop when the interval is "too small".
i have worked very enough with serial port(RS 232).
but never heard of the cts pin and dcb.
atleast for my information please educate me regarding those.
then i will try to solve if it in my perview.
I use PCOMM library for sending and receiving data using serial port.
functions are like
sio_ioctl(); to define the port settings.
soi_iqueue();to find weather any data is there in the port.
may be i can help you if you are also using these libraries and functions.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture