Skip to content

Commit

Permalink
Avoid calling ImmutableVector(0, v)
Browse files Browse the repository at this point in the history
The code for algebraic extensions passed fam!.rchar to ImmutableVector;
but that value was 0 if the characteristic exceeded 256.
  • Loading branch information
fingolfin committed Oct 14, 2020
1 parent 9723019 commit f827a88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/algfld.gi
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ local fam,i,cof,red,rchar,impattr,deg,tmp;
else
rchar:=0;
fi;
fam!.rchar:=rchar;
fam!.rchar:=Size(f);

fam!.poly:=p;
fam!.polCoeffs:=CoefficientsOfUnivariatePolynomial(p);
Expand Down
9 changes: 8 additions & 1 deletion tst/teststandard/algext.tst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
## Test of algebraic extensions.
##
#@local t, f0, p1, f1, p2, f2, p3, f3, p4, f4, x, l, a, ll, b
#@local t, f0, p1, f1, p2, f2, p3, f3, p4, f4, x, l, a, ll, b, pol, K, xinv, c
gap> START_TEST("algext.tst");
gap> t := Runtime();;
gap> f0 := GF(3);;
Expand All @@ -25,5 +25,12 @@ gap> b := RootOfDefiningPolynomial(ll);;
gap> (a+b)^5-(a-b)^5;
20*alpha^2*beta^3+(10*alpha^2-10)*beta+!4

#
gap> pol := UnivariatePolynomial(GF(293), Z(293)^0 * ConwayPol(293,8));;
gap> K := AlgebraicExtension(GF(293), pol);;
gap> xinv := 1/PrimitiveElement(K);
Z(293)^145*a^7+Z(293)^274*a^3+Z(293)^120*a^2+Z(293)^134*a+Z(293)^179
gap> c := Random(K);;

#
gap> STOP_TEST("algext.tst",1);

0 comments on commit f827a88

Please sign in to comment.