#2469 gcfactor fail

open
nobody
5
2012-09-10
2012-09-10
Stavros Macrakis
No

Apparently gcfactor requires an *explicit* Gaussian integer argument of the form AAA + BBB * %i, not an expression equivalent to that.
This should not be necessary. But at the very least, it should be documented.

foo: 74*%i-11*(%i+1)^2*(%i+2)*(2*%i+1) $ <<< simplified but unexpanded number

gcfactor(foo) => 74*%i+110 <<< expanded but not factored

gcfactor(gcfactor(foo)) == gcfactor(expand(foo)) == gcfactor(ratsimp(foo)) =>
%i*(1+%i)^3*(2+3*%i)^3 <<< correct factorization

Discussion

    • labels: --> Lisp Core - Complex