Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

user_math_sup.cpp File Reference

Supplimental integer math functions. More...

#include "mpi.h"

Namespaces

namespace  mp

Functions

mpi abs (const mpi &n)
 Absolute value.
mpi sqr (const mpi &n)
 Squaring.
mpi pow (const mpi &base, int_type p)
mpi pow_mod (const mpi &base, const mpi &p, const mpi &m)
 Modular exponentiation.
mpi euclid (const mpi &x, const mpi &y)
 Euclid's method for.
mpi factorial (const mpi &n)
mpi gcd (const mpi &x, const mpi &y)
 Greatest common divisor.


Detailed Description

Supplimental integer math functions.

These are all non-member funcitons


Function Documentation

mpi mp::abs const mpi &  n  ) 
 

Absolute value.

Parameters:
n Number to take the absolute value of
Returns:
Result: abs(n)

mpi mp::euclid const mpi &  x,
const mpi &  y
 

Euclid's method for.

mpi mp::factorial const mpi &  n  ) 
 

Parameters:
n Number to take the factorial of
Returns:
Result: n !

mpi mp::gcd const mpi &  x,
const mpi &  y
 

Greatest common divisor.

Parameters:
x First operand
y Second operand
Returns:
Greatest common divisor of x and y

mpi pow const mpi &  base,
int_type  p
 

mpi mp::pow_mod const mpi &  base,
const mpi &  p,
const mpi &  mod
 

Modular exponentiation.

Parameters:
base Base of the operation
p Exponant of the operation
mod Divisor of the operation
Returns:
Result: (base ^ p) % mod

mpi mp::sqr const mpi &  n  ) 
 

Squaring.

Parameters:
n Number to square
Returns:
Result: n ^ 2


Generated on Fri Feb 4 16:17:55 2005 for LibMP++ by  doxygen 1.4.1