.\" Copyright (c) 1986 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)mp.3 6.4 (Berkeley) %G%
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
.B "typedef struct mint { int len; short *val; } MINT;"
.B MINT *a, *b, *c, *m, "*q, *r;"
These routines perform arithmetic on integers of
The integers are stored using the defined type
can be initialized using the function
which sets the initial value to
After that, space is managed automatically by the routines.
.IR madd , " msub " and " mult"
product, respectively, of
the quotient and remainder obtained
except that the divisor is a short integer
and the remainder is placed in a short
whose address is given as
produces the integer square root of
and places the remainder in
raised to the (``regular'' integral) power
calculates this with a full multiple precision exponent
and the result is reduced modulo
returns the greatest common denominator of
.IR a " and " b " in " c ,
.IR c " such that " a*c " mod " b " = 1,"
returns a negative, zero or positive integer value when
is less than, equal to or greater than
do decimal input and output while
do octal input and output.
do decimal input and output using file
do I/O with arbitrary radix
On input, records should have the form of
strings of digits terminated by a newline;
output records have a similar form.
Programs which use the multiple-precision arithmetic library
must be loaded using the loader flag
/usr/include/mp.h include file
/usr/lib/libmp.a object code library
Illegal operations and running out of memory
produce messages and core images.
Bases for input and output should be <= 10.
The input and output routines are a crock.
is also the name of a standard math library routine.