cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern int qertf (float a, float b, float c, /*@out@*/ float [/* 2 */] x1, /*@out@*/ float [/* 2 */] x2); extern int qert (double a, double b, double c, /*@out@*/ double [/* 2 */] x1, /*@out@*/ double [/* 2 */] x2); extern int qertl (long double a, long double b, long double c, /*@out@*/ long double [/* 2 */] x1, /*@out@*/ long double [/* 2 */] x2); extern int qertw (__float80 a, __float80 b, __float80 c, /*@out@*/ __float80 [/* 2 */] x1, /*@out@*/ __float80 [/* 2 */] x2); extern int qertq (__float128 a, __float128 b, __float128 c, /*@out@*/ __float128 [/* 2 */] x1, /*@out@*/ __float128 [/* 2 */] x2); extern int qertll (long_long_double a, long_long_double b, long_long_double c, /*@out@*/ long_long_double [/* 2 */] x1, /*@out@*/ long_long_double [/* 2 */]) extern int qertdf (decimal_float a, decimal_float b, decimal_float c, /*@out@*/ decimal_float [/* 2 */] x1, /*@out@*/ decimal_float [/* 2 */] x2); extern int qertd (decimal_double a, decimal_double b, decimal_double c, /*@out@*/ decimal_double [/* 2 */] x1, /*@out@*/ decimal_double [/* 2 */] x2); extern int qertdl (decimal_long_double a, decimal_long_double b, decimal_long_double c, /*@out@*/ decimal_long_double [/* 2 */] x1, /*@out@*/ decimal_long_double [/* 2 */] x2); extern int qertdll (decimal_long_long_double a, decimal_long_long_double b, decimal_long_long_double c, /*@out@*/ decimal_long_long_double [/* 2 */] x1, /*@out@*/ decimal_long_long_double [/* 2 */] x2);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
The roots are always ordered such that Real(x1) <= Real(x2), since that is convenient in root-following applications.
This function is absent from programming-language standards, but a robust implementation is sufficiently intricate that it needs to be a library function.
The function value is 0 if both roots are real.
The function value is +1 if the roots are complex or pure imaginary.