Skip to content

Commit

Permalink
gmpints: increase test coverage
Browse files Browse the repository at this point in the history
Specifically, add tests designed to trigger the ObjInt_UIntInv call
inside of GMPorINTOBJ_FAKEMPZ.
  • Loading branch information
fingolfin committed Jan 16, 2017
1 parent 08da809 commit 3549c0b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tst/testinstall/intarith.tst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ gap> List(data, x -> bigPos - x);
gap> ForAll(data, x -> ForAll(data, y -> (x-y) = -(y-x)));
true

# verify corner case in GMPorINTOBJ_FAKEMPZ in ObjInt_UIntInv:
# difference of two large gmps is small, but not quite small enough for
# an immediate
gap> 2^100 - (2^100 + 2^60);
-1152921504606846976
gap> 2^100 - (2^100 + 2^62);
-4611686018427387904
gap> 2^100 - (2^100 + 2^28);
-268435456
gap> 2^100 - (2^100 + 2^30);
-1073741824

#
# ProdInt
#
Expand Down

0 comments on commit 3549c0b

Please sign in to comment.