From 74649926756d22bbd30abba76458493c4eea3757 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 4 Jul 2018 17:01:13 +0200 Subject: [PATCH] Install {8,16,32}Bits_Quotient kernel funcs as methods Resolves #2504 --- lib/wordrep.gi | 18 ++++++++++++++++++ tst/testinstall/wordrep.tst | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/wordrep.gi b/lib/wordrep.gi index 0ddbbf233d..a4f07dfe8d 100644 --- a/lib/wordrep.gi +++ b/lib/wordrep.gi @@ -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, @@ -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, @@ -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, diff --git a/tst/testinstall/wordrep.tst b/tst/testinstall/wordrep.tst index ae133f9262..bb216811f9 100644 --- a/tst/testinstall/wordrep.tst +++ b/tst/testinstall/wordrep.tst @@ -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 ] #