SolveEquation2n


Overloaded template function to solve quadratic equations. It can be used only with float data types.

You can find more information in comments below.

// Find solutions of x * x + ax + b = 0 equation and store them in x1 and x2. Return number of found solutions including complex ones. Return either 1 or 2template<class TYPE>
int SolveEquation2n(const TYPE a, const TYPE b, TComplex<TYPE> &x1, TComplex<TYPE> &x2);
// Find solutions of a * x * x + bx + c = 0 equation and store them in x1 and x2. Return number of found solutions including complex ones. Return 0(if both a and b are zero), 1 or 2. Tolerance is used to compare a and b with zerotemplate<class TYPE>
int SolveEquation2n(const TYPE a, const TYPE b, const TYPE c, TComplex<TYPE> &x1, TComplex<TYPE> &x2, const TYPE tolerance);
Namespace: ntl
Include: NTL/Core/Complex.h