powered by
Test for a multivariate polynomial being zero
is.zero(x)
Object of class mvp
mvp
Robin K. S. Hankin
Function is.zero() returns TRUE if x is indeed the zero polynomial. It is defined as length(vars(x))==0 for reasons of efficiency, but conceptually it returns x==constant(0).
is.zero()
TRUE
x
length(vars(x))==0
x==constant(0)
(Use constant(0) to create the zero polynomial).
constant(0)
constant
constant(0) t1 <- as.mvp("x+y") t2 <- as.mvp("x-y") stopifnot(is.zero(t1*t2-as.mvp("x^2-y^2")))
Run the code above in your browser using DataLab