Skip to content

Commit

Permalink
Invalid use of / on ZmodnZObjs now gives error
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Aug 21, 2019
1 parent 42a7c0d commit 9101aa9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/zmodnz.gi
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ InstallMethod( \/,
q := QuotientMod( Integers, x![1], y![1],
Fam!.Characteristic );
if q = fail then
return fail;
Error("invalid division");
fi;
return ZmodnZObj( Fam, q );
end );
Expand All @@ -428,7 +428,7 @@ InstallMethod( \/,
q := QuotientMod( Integers, x![1], y,
Fam!.Characteristic );
if q = fail then
return fail;
Error("invalid division");
fi;
return ZmodnZObj( Fam, q );
end );
Expand All @@ -442,7 +442,7 @@ InstallMethod( \/,
q := QuotientMod( Integers, x, y![1],
Fam!.Characteristic );
if q = fail then
return fail;
Error("invalid division");
fi;
return ZmodnZObj( Fam, q );
end );
Expand Down
12 changes: 6 additions & 6 deletions tst/testinstall/zmodnz.tst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ ZmodnZObj( 4, 6 )
gap> Quotient(R, ZmodnZObj(2,6), ZmodnZObj(5,6));
ZmodnZObj( 4, 6 )
gap> ZmodnZObj(5,6) / ZmodnZObj(2,6);
fail
Error, invalid division
gap> Quotient(R, ZmodnZObj(5,6), ZmodnZObj(2,6));
fail
Expand All @@ -332,7 +332,7 @@ ZmodnZObj( 2, 6 )
gap> Quotient(R, ZmodnZObj(0,6), ZmodnZObj(2,6));
ZmodnZObj( 0, 6 )
gap> ZmodnZObj(2,6) / ZmodnZObj(0,6);
fail
Error, invalid division
gap> Quotient(R, ZmodnZObj(2,6), ZmodnZObj(0,6));
fail
Expand Down Expand Up @@ -482,21 +482,21 @@ ZmodnZObj( 2, 10 )
gap> y := ZmodnZObj(0,10);
ZmodnZObj( 0, 10 )
gap> x/y;
fail
Error, invalid division
gap> y/x;
ZmodnZObj( 0, 10 )
gap> 0/x;
ZmodnZObj( 0, 10 )
gap> x/0;
fail
Error, invalid division
gap> x/3;
ZmodnZObj( 4, 10 )
gap> 3/x;
fail
Error, invalid division
gap> y/3;
ZmodnZObj( 0, 10 )
gap> 3/y;
fail
Error, invalid division
#
gap> R := Integers mod 4;;
Expand Down

0 comments on commit 9101aa9

Please sign in to comment.