factor



"Stavros Macrakis" <stavros.macrakis@verizon.net> writes:

> > 	(C1) factor(x^2+1,%i^2+1);
> > 	Error: Caught fatal error [memory may be damaged]
> 
> Factor requires its second argument to be an irredicible univariate
> polynomial.  It does not check this, and usually gives a fatal error if
> it is not.

Yes, but it does check that its second argument is univariate and not
linear, which is enough to catch the factor(..., 0) case above, except
that there seems to be the following small bug.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: rat3e.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/rat3e.lisp,v
retrieving revision 1.4
diff -u -r1.4 rat3e.lisp
--- rat3e.lisp	27 Sep 2002 02:49:03 -0000	1.4
+++ rat3e.lisp	27 Oct 2003 01:48:21 -0000
@@ -292,8 +292,8 @@
 		    (SETQ ALPHA (MEQHK (ARG 2)))
 		    (NEWVAR ALPHA)
 		    (SETQ MINPOLY* (CADR (RATREP* ALPHA)))
-		    (IF (OR (NOT (UNIVAR (CDR MINPOLY*)))
-			    (PCOEFP MINPOLY*)
+		    (IF (OR (PCOEFP MINPOLY*)
+			    (NOT (UNIVAR (CDR MINPOLY*)))
 			    (f< (CADR MINPOLY*) 2))
 			(MERROR
 			  "The second argument to FACTOR must be a non-linear, univariate polynomial:~%~M"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Wolfgang