Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IsCheapConwayPolynomial( p, 1 ) for p < 1000 #5531

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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

Check warning on line 505 in lib/polyconw.gi

View check run for this annotation

Codecov / codecov/patch

lib/polyconw.gi#L505

Added line #L505 was not covered by tests
return true;
fi;
elif p < 100 then
if n < 40 and IsPrimeInt(n) then
if n < 40 and (n = 1 or IsPrimeInt(n)) then

Check warning on line 509 in lib/polyconw.gi

View check run for this annotation

Codecov / codecov/patch

lib/polyconw.gi#L509

Added line #L509 was not covered by tests
return true;
fi;
elif p < 1000 then
if n < 14 and IsPrimeInt(n) then
if n < 14 and (n = 1 or IsPrimeInt(n)) then

Check warning on line 513 in lib/polyconw.gi

View check run for this annotation

Codecov / codecov/patch

lib/polyconw.gi#L513

Added line #L513 was not covered by tests
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