X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/98421fc1a6832ad5de4b3f6171852437aa3e0fb2..2c70dfbf7facca44ff6074d865f429a6ae0ace5e:/math/mp.h diff --git a/math/mp.h b/math/mp.h index ad4309e9..0434c282 100644 --- a/math/mp.h +++ b/math/mp.h @@ -892,6 +892,19 @@ extern mp *mp_exp(mp */*d*/, mp */*a*/, mp */*e*/); extern mp *mp_odd(mp */*d*/, mp */*m*/, size_t */*s*/); +/* --- @mp_leastcongruent@ --- * + * + * Arguments: @mp *d@ = pointer to destination + * @mp *b@ = lower bound + * @mp *r@ = representative + * @mp *m@ = modulus + * + * Returns: The smallest integer %$x \equiv r \pmod{m}$% such that + * %$x \ge b$%. + */ + +extern mp *mp_leastcongruent(mp */*d*/, mp */*b*/, mp */*r*/, mp */*m*/); + /*----- More advanced algorithms ------------------------------------------*/ /* --- @mp_sqrt@ --- *