creachadair / imath

Arbitrary precision integer and rational arithmetic library
Other
129 stars 20 forks source link

Fix gmp compat divisible_p for d == 0 and n != 0 #16

Closed Meinersbur closed 7 years ago

Meinersbur commented 7 years ago

Any value other than 0 is not considered divisible by 0. Without this fix, trying to check divisibility by 0 would result in the following assertion:

Assertion `((isl_mp_int_div(n, d, ((void *)0), r)) == MP_OK) && "expected MP_OK"' failed.

This is a pull request on behalf of Sven Verdoolaege.