Skip to content

Commit

Permalink
Fix IsCheapConwayPolynomial( p, 1 ) for p < 1000 (#5531)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankluebeck authored Nov 17, 2023
1 parent 6f50fa7 commit 962db5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/polyconw.gi
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,15 @@ InstallGlobalFunction( IsCheapConwayPolynomial, function( p, n )
fi;
# this is not very precise, hopefully good enough for the moment
if p < 41 then
if n < 100 and IsPrimeInt(n) then
if n < 100 and (n = 1 or IsPrimeInt(n)) then
return true;
fi;
elif p < 100 then
if n < 40 and IsPrimeInt(n) then
if n < 40 and (n = 1 or IsPrimeInt(n)) then
return true;
fi;
elif p < 1000 then
if n < 14 and IsPrimeInt(n) then
if n < 14 and (n = 1 or IsPrimeInt(n)) then
return true;
fi;
elif p < 2^48 then
Expand Down
2 changes: 2 additions & 0 deletions tst/testinstall/ffeconway.tst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ gap> fieldpairs := Concatenation(List(fieldsizes, pd -> List(Filtered([1..pd[2]-
[ 257, 11, 1 ], [ 65521, 2, 1 ], [ 65537, 2, 1 ], [ 268435399, 2, 1 ],
[ 4294967291, 2, 1 ], [ 1152921504606846883, 3, 1 ],
[ 18446744073709551629, 2, 1 ] ]
gap> IsCheapConwayPolynomial( 997, 1 );
true

#
# construct generating elements
Expand Down

0 comments on commit 962db5c

Please sign in to comment.