Skip to content

Commit

Permalink
Teach Units(GF(q)) its size
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Mar 1, 2018
1 parent abe1a58 commit ad6bb49
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/fieldfin.gi
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ InstallMethodWithRandomSource( Random,
InstallMethod( Units,
"for a finite field",
[ IsField and IsFinite ],
F -> GroupByGenerators( [ PrimitiveRoot( F ) ] ) );
function ( F )
local G;
G := GroupByGenerators( [ PrimitiveRoot( F ) ] );
if HasSize( F ) then
SetSize( G, Size( F )-1 );
fi;
return G;
end );


#############################################################################
Expand Down

0 comments on commit ad6bb49

Please sign in to comment.