Important: The information in this document is obsolete and should not be used for new development.
LinearRoot
You can use theLinearRoot
function to obtain the root of a linear equation.
long LinearRoot(Fixed first, Fixed last, fract t[]);
first
- The first coefficient.
last
- The last coefficient.
t
- An array of fract numbers. On return, it contains the roots of the equation.
- function result
- The number of roots of the linear equation. This value may be 0 or 1
(or -1 if all values of t are roots).DESCRIPTION
TheLinearRoot
function computes any t between 0 and 1 in which a(1 - t) + bt = 0. The coefficient a is the parameterfirst
. The coefficient b is the parameterlast
. The function returns the number of roots between 0 and 1.Any root is returned in the
t
array, which only needs to hold one value. If both a and b are zero, the function returns the number -1, indicating that a(1 - t) + bt = 0 for all t.