chiark / gitweb /
rand/rand-x86ish.S: Hoist argument register allocation outside.
[catacomb] / math / mp.h
index ad4309e915ec89bea760fb707da4152ac12dda88..0434c28243b7b914913c5cadf9ea74c69d78f290 100644 (file)
--- 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@ --- *