Jacobi symbol using Lehmer's algorithm.

Torbjorn Granlund tg at gmplib.org
Thu Feb 25 15:51:33 CET 2010


nisse at lysator.liu.se (Niels Möller) writes:

  I'm slowly looking at the jacobi testing issues. In refmpz.c there are
  three functions:
  
  * refmpz_kronecker. Used in tests/devel/try.c. 
  
  * refmpz_jacobi. Used by tests/devel/try.c. The definition is somewhat
    fishy to me, instead of asserting that b is odd, it removes any power
    of two present in b.
  
  * refmpz_legendre. Not used at all.
  
  I'm about to rewrite refmpz_legendre, using powm.

Please use a refmpz_powm, not mpz_powm, since we might at some point use
mpz_powm for mpz_legendre.

You're planning to start using refmpz_legendre?  (If the function is
unused, we might as well remove it, or ifdef it out.)

  I'm also tempted to change refmpz_jaboci to require b odd, ...

This makes sense.

-- 
Torbjörn


More information about the gmp-devel mailing list