Solve a univariate mpoly with polyroot

solve_unipoly(mpoly, real_only = FALSE)

Arguments

mpoly

an mpoly

real_only

return only real solutions?

Examples

solve_unipoly(mp("x^2 - 1")) # check x = -1, 1
#> [1] 1+0i -1+0i
solve_unipoly(mp("x^2 - 1"), real_only = TRUE)
#> [1] 1 -1