Skip to content

Commit

Permalink
Merge pull request #519 from skirpichev/misc
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
casevh authored Oct 5, 2024
2 parents 9177648 + 71c1186 commit 7460aff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gmpy2.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ gmp_abort_handler(int i)
printf("gmp: root of negative\n");
}
else {
printf("gmp: out of memory\n");
printf("gmp: overflow in mpz type\n");
}
}
abort();
Expand Down
5 changes: 4 additions & 1 deletion test/test_mpz.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,14 @@ def test_mpz_create():
assert mpz(' 1 2') == mpz(12)


@settings(max_examples=10000)
@given(integers())
@example(0)
@example(-3)
def test_mpz_conversion_bulk(n):
assert int(mpz(n)) == n
m = mpz(n)
assert int(m) == n
assert str(m) == str(n)


@settings(max_examples=1000)
Expand Down

0 comments on commit 7460aff

Please sign in to comment.