polynomial: add isConstant() method.