Re: bdiv vs redc

2012-07-17 Thread Torbjorn Granlund
ni...@lysator.liu.se (Niels Möller) writes: ni...@lysator.liu.se (Niels Möller) writes: Some other test cases fail, though: t-root, t-perfpow, t-divis, and t-cong. I'm not familiar with this code, I had a quick look at the root code but didn't see any obvious dependency on bdiv.

Re: bdiv vs redc

2012-07-17 Thread Torbjorn Granlund
ni...@lysator.liu.se (Niels Möller) writes: How do you define hensel square root with remainder? Given a and n, if there exists an x such that x^2 = a (mod B^n), that seems like the reasonable definition of the square root. But what if no such x exists; where should we put the remainder

Re: bdiv vs redc

2012-07-17 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: I don't think a remainder is meaningful here. Ok, so the return value should be a proper root mod B^k (B = 2^{GMP_NUMB_BITS, as usual), or an indication that no root exists. When a square root exists (and the input is non-zero), then there are two