]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/include/mp.h
vt: fix %.*s in sendncars()
[plan9front.git] / sys / include / mp.h
index f883712dee6a64dab8224d6265a1a612774b0c3b..0de6db39c8e67f90c4c02cb8a8dc580ec407ee02 100644 (file)
@@ -62,6 +62,8 @@ uvlong        mptouv(mpint*);                 /* unsigned vlong */
 mpint* uvtomp(uvlong, mpint*);
 vlong  mptov(mpint*);                  /* vlong */
 mpint* vtomp(vlong, mpint*);
+double mptod(mpint*);                  /* double */
+mpint* dtomp(double, mpint*);
 
 /* divide 2 digits by one */
 void   mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient);
@@ -84,6 +86,7 @@ void  mpnot(mpint *b, mpint *res);
 void   mpxor(mpint *b1, mpint *b2, mpint *res);
 void   mptrunc(mpint *b, int n, mpint *res);
 void   mpxtend(mpint *b, int n, mpint *res);
+void   mpasr(mpint *b, int shift, mpint *res);
 
 /* modular arithmetic, time invariant when 0≤b1≤m-1 and 0≤b2≤m-1 */
 void   mpmodadd(mpint *b1, mpint *b2, mpint *m, mpint *sum);   /* sum = b1+b2 % m */
@@ -99,6 +102,9 @@ int  mpcmp(mpint *b1, mpint *b2);
 /* res = s != 0 ? b1 : b2 */
 void   mpsel(int s, mpint *b1, mpint *b2, mpint *res);
 
+/* return n! */
+mpint* mpfactorial(ulong n);
+
 /* extended gcd return d, x, and y, s.t. d = gcd(a,b) and ax+by = d */
 void   mpextendedgcd(mpint *a, mpint *b, mpint *d, mpint *x, mpint *y);