result = Polynomial.numberOfRoots(p);
Calculate number of roots of a polynomial p
.
import Modelica_LinearSystems2.Math.Polynomial; x = Polynomial.x(); p1 = -6*x^2 + 4*x -3; Polynomial.numberOfRoots(p1); // = 2
encapsulated function numberOfRoots import Modelica_LinearSystems2.Math.Polynomial; input Polynomial p "Polynomial"; output Integer result "Number of roots of p"; end numberOfRoots;