Skip to content

Commit

Permalink
Install {8,16,32}Bits_Quotient kernel funcs as methods
Browse files Browse the repository at this point in the history
Resolves #2504
  • Loading branch information
fingolfin committed Jul 5, 2018
1 parent 154d3c3 commit 7464992
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions lib/wordrep.gi
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ InstallMethod( \*,
[ Is8BitsAssocWord, Is8BitsAssocWord ], 0,
8Bits_Product );

InstallMethod( \/,
"for two 8 bits assoc. words",
IsIdenticalObj,
[ Is8BitsAssocWord, Is8BitsAssocWord and IsMultiplicativeElementWithInverse ], 0,
8Bits_Quotient );

InstallMethod( OneOp,
"for an 8 bits assoc. word-with-one",
true,
Expand Down Expand Up @@ -561,6 +567,12 @@ InstallMethod( \*,
[ Is16BitsAssocWord, Is16BitsAssocWord ], 0,
16Bits_Product );

InstallMethod( \/,
"for two 16 bits assoc. words",
IsIdenticalObj,
[ Is16BitsAssocWord, Is16BitsAssocWord and IsMultiplicativeElementWithInverse ], 0,
16Bits_Quotient );

InstallMethod( OneOp,
"for a 16 bits assoc. word-with-one",
true,
Expand Down Expand Up @@ -654,6 +666,12 @@ InstallMethod( \*,
[ Is32BitsAssocWord, Is32BitsAssocWord ], 0,
32Bits_Product );

InstallMethod( \/,
"for two 32 bits assoc. words",
IsIdenticalObj,
[ Is32BitsAssocWord, Is32BitsAssocWord and IsMultiplicativeElementWithInverse ], 0,
32Bits_Quotient );

InstallMethod( OneOp,
"for a 32 bits assoc. word-with-one",
true,
Expand Down
6 changes: 3 additions & 3 deletions tst/testinstall/wordrep.tst
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ gap> words32 := [u32,v32,w32,x32];; ForAll(words32, Is32BitsAssocWord);
true

#
gap> SetX(words8, words8, {a,b} -> (a/b) = 8Bits_Quotient(a,b));
gap> SetX(words8, words8, {a,b} -> (a/b) * b = a);
[ true ]
gap> SetX(words16, words16, {a,b} -> (a/b) = 16Bits_Quotient(a,b));
gap> SetX(words16, words16, {a,b} -> (a/b) * b = a);
[ true ]
gap> SetX(words32, words32, {a,b} -> (a/b) = 32Bits_Quotient(a,b));
gap> SetX(words32, words32, {a,b} -> (a/b) * b = a);
[ true ]

#
Expand Down

0 comments on commit 7464992

Please sign in to comment.