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

Natural numbers


Modules

 Signed integers

Classes

class  mp::mpn_
 First level core class that provides natural numbers to the MP++ library. More...

Functions

radix_type mp::guessbase (const string &s, radix_type b)
 Guess the base of a number in a string.
string::size_type mp::isNum (const string &s, radix_type b)
 Count the number of digits in a valid number.
void mp::setchunk (mpn_::radix_type b, std::string::size_type &chunksize, mpn_::limb_type &chunk)
 Sets the chunk size for a particular base.
void mp::stringclean (string &s, mpn_::radix_type b, int clear_zero)
 Clean out the strings that will be converted with mpn_::setString().

Function Documentation

radix_type guessbase const std::string &  s,
radix_type  b
 

Guess the base of a number in a string.

Uses the first few characters to guess what base the number is.

Parameters:
s String to examine
b Default base to check the number against
Returns:
Likely base of number in s

string::size_type isNum const std::string &  s,
radix_type  b
 

Count the number of digits in a valid number.

Parameters:
s String to examine
b Default base to use
Returns:
Number of digits, starting from the left, that contain a valid number

void setchunk mpn_::radix_type  b,
std::string::size_type chunksize,
mpn_::limb_type chunk
 

Sets the chunk size for a particular base.

A chunk is the largest power of the base that can fit inside a limb.

Parameters:
b Base to find the chunk of
chunksize The exponant of the base that creates the chunk
chunk The actual power of b

void stringclean std::string &  s,
mpn_::radix_type  b,
int  clear_zero
 

Clean out the strings that will be converted with mpn_::setString().

Parameters:
s String to clean
b Base to clean for
clear_zero Extraneous zeros will be removed starting from:
  • clear_zero = 0: none
  • clear_zero < 0: left
  • clear_zero > 0: right


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