diff --git a/lib/float.gi b/lib/float.gi index 02f03778c2..2a0588b1a8 100644 --- a/lib/float.gi +++ b/lib/float.gi @@ -1058,7 +1058,19 @@ InstallMethod( \^, "for float and rational", ReturnTrue, [ IsFloat, IsRat ], -1, end ); InstallMethod( \^, "for floats", ReturnTrue, [ IsFloat, IsFloat ], -1, function ( x, y ) return x ^ MakeFloat(x,y); end ); - + + +InstallMethod( IsGeneratorsOfMagmaWithInverses, + "for a collection of floats (return false)", + [ IsFloatCollection ], + SUM_FLAGS, # override everything else + function( gens ) + Info( InfoWarning, 1, + "no groups of floats allowed because of incompatible ^" ); + return false; + end ); + + ############################################################################# ## #E diff --git a/tst/testbugfix/2018-03-27-float-group.tst b/tst/testbugfix/2018-03-27-float-group.tst new file mode 100644 index 0000000000..571186d2d7 --- /dev/null +++ b/tst/testbugfix/2018-03-27-float-group.tst @@ -0,0 +1,13 @@ +# Disallow creating groups with non-associative generators. +# See issue #823 +gap> Group(2.0); +#I no groups of floats allowed because of incompatible ^ +Error, usage: Group(,...), Group(), Group(,) +gap> Group(2.0,3.0); +#I no groups of floats allowed because of incompatible ^ +Error, usage: Group(,...), Group(), Group(,) +gap> Group([], 1.0); + +gap> Group([2.0], 1.0); +#I no groups of floats allowed because of incompatible ^ +Error, usage: Group(,...), Group(), Group(,)