bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

divisibility tests


From: Jason Moxham
Subject: divisibility tests
Date: Wed, 13 Nov 2002 07:25:13 +0000
User-agent: KMail/1.4.1

The divisibilitys tests
mpz_divisible_p and mpz_divisible_ui_p give DIVIDE_BY_ZERO errors
when the denominator is zero.

The usual definition of divisibilty is

a divides b iff there exists a c such that ca=b

therefore

mpz_divisible_p(x,z) should return 0

and 
mpz_divisible_p(z,z) should return 1

instead of a DIVIDE_BY_ZERO error

where x is a non-zero mpz varible and z is zero mpz varible

same for mpz_divisible_ui_p and perhaps mpz_congruent's

mpz_divisible is testing that one number is divisible by another , not doing 
any division , so it should not have a DIVIDE_BY_ZERO error.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]