-.TH MP 3X "June 4, 1986"
-.UC 6
-.SH NAME
-madd, msub, mult, mdiv, pow, gcd, invert, rpow, msqrt, mcmp,
-move, min, omin, fmin, m_in, mout, omout, fmout, m_out, sdiv, itom
-\- multiple precision integer arithmetic
-.SH SYNOPSIS
-.nf
-.B #include <mp.h>
-.B #include <stdio.h>
-.PP
-.B "typedef struct mint { int len; short *val; } MINT;"
-.PP
-.B madd(a, b, c)
-.B msub(a, b, c)
-.B mult(a, b, c)
-.B mdiv(a, b, q, r)
-.B pow(a, b, m, c)
-.B gcd(a, b, c)
-.B invert(a, b, c)
-.B rpow(a, n, c)
-.B msqrt(a, b, r)
-.B mcmp(a, b)
-.B move(a, b)
-.B min(a)
-.B omin(a)
-.B fmin(a, f)
-.B m_in(a, n, f)
-.B mout(a)
-.B omout(a)
-.B fmout(a, f)
-.B m_out(a, n, f)
-.B MINT *a, *b, *c, *m, "*q, *r;"
-.B FILE *f;
-.B int n;
-.PP
-.B sdiv(a, n, q, r)
-.B MINT *a, *q;
-.B short n;
-.B short *r;
-.PP
-.B MINT *itom(n)
-.SH DESCRIPTION
-These routines perform arithmetic on integers of
-arbitrary length.
-The integers are stored using the defined type
-.IR MINT .
-Pointers to a
-.I MINT
-can be initialized using the function
-.I itom
-which sets the initial value to
-.IR n .
-After that, space is managed automatically by the routines.
-.PP
-.IR madd , " msub " and " mult"
-assign to
-.I c
-the sum, difference and
-product, respectively, of
-.IR a " and " b .
-.I mdiv
-assigns to
-.IR q " and " r
-the quotient and remainder obtained
-from dividing
-.IR a " by " b.
-.I sdiv
-is like
-.I mdiv
-except that the divisor is a short integer
-.I n
-and the remainder is placed in a short
-whose address is given as
-.IR r .
-.I msqrt
-produces the integer square root of
-.IR a " in " b
-and places the remainder in
-.IR r .
-.I rpow
-calculates in
-.I c
-the value of
-.I a
-raised to the (``regular'' integral) power
-.IR n ,
-while
-.I pow
-calculates this with a full multiple precision exponent
-.I b
-and the result is reduced modulo
-.IR m .
-.I gcd
-returns the greatest common denominator of
-.IR a " and " b " in " c ,
+.\" @(#)mp.3 8.1 (Berkeley) 6/4/93
+.\"
+.Dd June 4, 1993
+.Dt MP 3
+.Os BSD 4.3
+.Sh NAME
+.Nm fmin ,
+.Nm fmout ,
+.Nm gcd ,
+.Nm invert ,
+.Nm itom
+.Nm m_in ,
+.Nm m_out ,
+.Nm madd ,
+.Nm mcmp,
+.Nm mdiv ,
+.Nm min ,
+.Nm mout ,
+.Nm move ,
+.Nm msqrt ,
+.Nm msub ,
+.Nm mult ,
+.Nm omin ,
+.Nm omout ,
+.Nm pow ,
+.Nm rpow ,
+.Nm sdiv ,
+.Nd multiple precision integer arithmetic
+.Sh SYNOPSIS
+.Fd #include <mp.h>
+.Fd #include <stdio.h>
+.Fd "typedef struct mint { int len; short *val; } MINT;"
+.Fn madd "MINT *a" "MINT *b" "MINT *c"
+.Fn msub "MINT *a" "MINT *b" "MINT *c"
+.Fn mult "MINT *a" "MINT *b" "MINT *c"
+.Fn mdiv "MINT *a" "MINT *b" "MINT *q" "short r"
+.Fn pow "MINT *a" "MINT *b" m "MINT *c"
+.Fn gcd "MINT *a" "MINT *b" "MINT *c"
+.Fn invert "MINT *a" "MINT *b" "MINT *c"
+.Fn rpow "MINT *a" "short n" "MINT *c"
+.Fn msqrt "MINT *a" "MINT *b" "short r"
+.Fn mcmp "MINT *a" "MINT *b"
+.Fn move "MINT *a" "MINT *b"
+.Fn min "MINT *a"
+.Fn omin "MINT *a"
+.Fn fmin "MINT *a" "FILE *f"
+.Fn m_in "MINT *a" "int n" "FILE *f"
+.Fn mout "MINT *a"
+.Fn omout "MINT *a"
+.Fn fmout "MINT *a" "FILE *f"
+.Fn m_out "MINT *a" "int n" "FILE *f"
+.Fn sdiv "MINT *a" "short n" "MINT *q" "short r"
+.Fn itom "short n"
+.Sh DESCRIPTION
+.Bf -symbolic
+The interface for this library is expected to change.
+.Ef
+.Pp
+These functions operate on integers of variable length.
+The function
+.Fn itom
+allocates space for an integer of length
+.Fa n
+which may be accessed via the returned
+.Fa MINT
+pointer.
+The underlying storage scheme is transparent to the user.
+.Pp
+.Bl -tag -width "mdivXXX" -compact
+.It Fn fmin
+.It Fn fmout
+Convert decimal input and output using file
+.Fa f .
+.Pp
+.It Fn gcd
+Finds the greatest common denominator of
+.Fa a