diff --git a/lib/polyfinf.gi b/lib/polyfinf.gi index 04acdb184b..289eb2c4d8 100644 --- a/lib/polyfinf.gi +++ b/lib/polyfinf.gi @@ -104,7 +104,11 @@ local br, ind, c, facs, deg, px, pow, cyc, gcd,d,powc,fc,fam; #px := LaurentPolynomialByExtRepNC( # FamilyObj(f), [One(br)],1, ind ); # pow := px; - px:=ImmutableVector(br, [Zero(br),-One(br)]); + if IsFinite(br) and IsField(br) and Size(br)>MAXSIZE_GF_INTERNAL then + px:=Immutable([Zero(br),-One(br)]); + else + px:=ImmutableVector(br, [Zero(br),-One(br)]); + fi; powc:=-px; fc:=CoefficientsOfLaurentPolynomial(f)[1]; fam:=FamilyObj(One(br)); diff --git a/lib/ratfun1.gi b/lib/ratfun1.gi index 1d7ca3d9dd..234a171672 100644 --- a/lib/ratfun1.gi +++ b/lib/ratfun1.gi @@ -42,7 +42,13 @@ local f,typ,lc; # slightly better to do this after the Length has been determined if IsFFECollection(coeff) and IS_PLIST_REP(coeff) then - coeff := ImmutableVector(DefaultRing(coeff), coeff); + f:=DefaultRing(coeff); + if IsFinite(f) and Size(f)>MAXSIZE_GF_INTERNAL then + # do not pack Zmodnz objects into vectors + coeff := Immutable(coeff); + else + coeff := ImmutableVector(f, coeff); + fi; fi;