Skip to content

Commit

Permalink
Prevent creation of groups of floats
Browse files Browse the repository at this point in the history
Fixes part of issue #823.
  • Loading branch information
fingolfin committed Mar 28, 2018
1 parent aff0989 commit b9b24ad
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/float.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions tst/testbugfix/2018-03-27-float-group.tst
Original file line number Diff line number Diff line change
@@ -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(<gen>,...), Group(<gens>), Group(<gens>,<id>)
gap> Group(2.0,3.0);
#I no groups of floats allowed because of incompatible ^
Error, usage: Group(<gen>,...), Group(<gens>), Group(<gens>,<id>)
gap> Group([], 1.0);
<trivial group>
gap> Group([2.0], 1.0);
#I no groups of floats allowed because of incompatible ^
Error, usage: Group(<gen>,...), Group(<gens>), Group(<gens>,<id>)

0 comments on commit b9b24ad

Please sign in to comment.