.TH MP 3X .SH NAME itom, madd, msub, mult, mdiv, min, mout, pow, gcd, rpow \- multiple precision integer arithmetic .SH SYNOPSIS .nf .B "typedef struct { int len; short *val; } mint;" .PP .PP .B madd(a, b, c) .B msub(a, b, c) .B mult(a, b, c) .B mdiv(a, b, q, r) .B min(a) .B mout(a) .B pow(a, b, m, c) .B gcd(a, b, c) .B rpow(a, b, c) .B msqrt(a, b, r) .B mint *a, *b, *c, *m, "*q, *r;" .PP .B .B sdiv(a, n, q, r) .B mint *a, *q; .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 .I mint. Pointers to a .I mint should be initialized using the function .IR itom , which sets the initial value to .IR n . After that space is managed automatically by the routines. .PP .IR madd , " msub" , " mult" , assign to their third arguments the sum, difference, and product, respectively, of their first two arguments. .I mdiv assigns the quotient and remainder, respectively, to its third and fourth arguments. .I sdiv is like .I mdiv except that the divisor is an ordinary integer. .I msqrt produces the square root and remainder of its first argument. .I rpow calculates .I a raised to the power .IR b , while .I pow calculates this reduced modulo .IR m . .IR min " and" mout do decimal input and output. .PP The functions are obtained with the loader option .IR -lmp . .SH DIAGNOSTICS Illegal operations and running out of memory produce messages and core images.