powered by
Number of distinct real roots of a univariate polynomial in a given interval.
numberOfRealRootsInInterval(qspray, lower, upper, closed = TRUE)
An integer, the number of real roots of the polynomial in the interval.
a univariate qspray polynomial
qspray
the bounds of the interval, bigq numbers or objects coercible to bigq numbers, and it is also possible to set lower = -Inf and upper = Inf
bigq
lower = -Inf
upper = Inf
Boolean, whether to consider the interval is closed or open
library(resultant) x <- qlone(1) P <- 2*x^4 + x^3 - 3*x^2 - x + 1 numberOfRealRootsInInterval(P, 0, 1)
Run the code above in your browser using DataLab