The remainder command computes the remainder of A divided by B where A and B can be integers or polynomials. In the polynomial case, the variable X must be specified as the third argument and an optional fourth argument P specifies the modulus.
# integers remainder(25,10); 5 # polynomials remainder(x^2+x+1,x+1,x); 1 # polynomials mod p remainder(x^2+x+1,x+1,x,11); 1