*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> mp (3)              
Title
Content
Arch
Section
 

mp(3)

Contents


NAME    [Toc]    [Back]

       mp,  madd,  msub,  mult,  mdiv,  gcd, invert, rpow, msqrt,
       mcmp, min, omin, fmin, m_in, mout,  omout,  fmout,  m_out,
       sdiv, itom - Perform multiple precision integer arithmetic

SYNOPSIS    [Toc]    [Back]

       #include <mp.h> #include <stdio.h>

       typedef struct mint {int len; short *val; } MINT

       void madd(
               MINT *a,
               MINT *b,
               MINT *c ); void msub(
               MINT *a,
               MINT *b,
               MINT *c ); void mult(
               MINT *a,
               MINT *b,
               MINT *c ); void mdiv(
               MINT *a,
               MINT *b,
               MINT *q,
               MINT *r ); void pow(
               MINT *a,
               MINT *b,
               MINT *m,
               MINT *c ); void gcd(
               MINT *a,
               MINT *b,
               MINT *c ); void invert(
               MINT *a,
               MINT *b,
               MINT *c ); void rpow(
               MINT *a,
               int n,
               MINT *c ); int msqrt(
               MINT *a,
               MINT *b,
               MINT *r ); int mcmp(
               MINT *a,
               MINT *b ); int mcmp(
               MINT *a,
               MINT *b ); void move(
               MINT *a,
               MINT *b ); int min(
               MINT *a ); int omin(
               MINT *a ); int fmin(
               MINT *a,
               FILE *f ); int m_in(
               MINT *a,
               int n,
               FILE *f ); void mout(
               MINT *a ); void omout(
               MINT *a ); void fmout(
               MINT *a,
               FILE *f ); void m_mout(
               MINT *a,
               int n,
               FILE *f ); void sdiv(
               MINT *a,
               short n,
               MINT *q,
               short *r ); MINT *itom(
               short n );

LIBRARY    [Toc]    [Back]

       Object Code Library (libmp.a)

       Curses Library (libcurses)

DESCRIPTION    [Toc]    [Back]

       These functions perform arithmetic on  integers  of  arbitrary
  length.  The  integers are stored using the defined
       type MINT. Pointers to a MINT  can  be  initialized  using
       theitom()  function,  which  sets  the initial value to n.
       After that, space is managed  automatically  by  the  routines.


       The  madd(), msub() , and mult() functions assign to c the
       sum, difference, and product, respectively, of a and b.

       The mdiv() function assigns to q and r  the  quotient  and
       remainder obtained from dividing a by b.  The sdiv() function
 is like the mdiv() function except that  the  divisor
       is  a  short  integer  n  and the remainder is placed in a
       short integer whose address is given as r.

       The msqrt() function produces the integer square root of a
       in b and places the remainder in r.

       The  rpow() function calculates in c the value of a raised
       to the (``regular'' integral) power  n,  while  the  pow()
       function  calculates  this  with a full multiple precision
       exponent b and the result is reduced modulo m.

       The gcd() function returns the greatest common denominator
       of a and b in c, and the invert() function computes c such
       that a*c mod b = 1, for a and b relatively prime.

       The mcmp() function returns a negative, zero, or  positive
       integer  value  when  a is less than, equal to, or greater
       than b, respectively.

       The move() function copies a to b.

       The min() and mout() functions do decimal input and output
       while  the omin() and omout() functions do octal input and
       output. More generally, the fmin() and  fmout()  functions
       do  decimal  input and output using file f, and m_in() and
       m_out do input and output with arbitrary radix n.

       On input, records should have the form of strings of  digits
 terminated by a newline; output records have a similar
       form.

NOTES    [Toc]    [Back]

       Programs  which  use  the  multiple-precision   arithmetic
       library must be compiled with -lmp.



                                                            mp(3)
[ Back ]
 Similar pages
Name OS Title
libmp FreeBSD traditional BSD multiple precision integer arithmetic library
dc Tru64 Provides an interactive desk calculator for arbitrary precision integer arithmetic
bc HP-UX arbitrary-precision arithmetic language
bc Tru64 Provides a processor for arbitrary-precision arithmetic language
bc OpenBSD arbitrary-precision arithmetic language and calculator
integer IRIX Perl pragma to compute arithmetic in integer instead of double
dot IRIX BLAS level ONE, dot product functions FORTRAN 77 SYNOPSIS double precision ddot( n, x, incx, y, incy ) integer
div IRIX perform integer division
asum IRIX BLAS level ONE L1 norm functions. FORTRAN 77 SYNOPSIS double precision dasum( n, x, incx ) integer incx, n dou
sprodm1du IRIX Compute the product of Multiple 1D Fourier transforms with Multiple 1D filters.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service