Arageli::big_float Class Reference

#include <big_float.hpp>

List of all members.

Public Member Functions

 big_float ()
 Constructor.
 big_float (const char *str)
 Converts str to a big_float.
 big_float (const big_float &b)
 Makes a copy of a number.
 big_float (const big_int &s, const big_int &e)
 big_float (double b)
 Converts b to a big number.
 big_float (int i)
 Converts b to a big number.
 ~big_float ()
 Destructor.
big_floatoperator= (const big_float &b)
 Assignment.
big_floatoperator= (const double d)
 Assignment.
big_floatoperator= (const char *str)
 Assignment.
big_floatoperator= (const int i)
big_int get_exponent () const
 Returns the exponent.
big_int get_significant () const
 Returns the significant.
void out (std::ostream &os, char c= 'd') const
 Formated output.
void in (std::istream &ins, char c= 'd')
 Input number.
int is_NaN ()
 returns 1 iff the number is NaN
int is_pInf ()
 returns 1 iff the number is +Infinity
int is_mInf ()
 returns 1 iff the number is -Infinity
int is_Inf ()
 returns 1 iff the number is +Infinity or -Infinity
int is_pZero ()
 returns 1 iff the number is +0
int is_mZero ()
 returns 1 iff the number is -0
int is_Zero ()
 returns 1 iff the number is +0 or -0
int is_Special ()
 returns 1 iff the number is Nan, Infinity or 0

Static Public Member Functions

static void set_global_precision (long p)
 Sets the global precision to p.
static void set_round_mode (int m=TO_NEAREST)
 Sets the global rounding mode.

Friends

std::ostream & operator<< (std::ostream &s, const big_float &x)
 Reads a number.
std::istream & operator>> (std::istream &s, big_float &x)
 Writes a number.
int cmp (const big_float &a, const big_float &b)
 Compares two numbers.
int operator== (const big_float &a, const big_float &b)
 Test for equality.
int operator!= (const big_float &a, const big_float &b)
 Test for inequality.
int operator> (const big_float &a, const big_float &b)
 Test for greater.
int operator>= (const big_float &a, const big_float &b)
 Test for greater than or equal to.
int operator< (const big_float &a, const big_float &b)
 Test for less.
int operator<= (const big_float &a, const big_float &b)
 Test for less than or equal to.
big_float operator+ (const big_float &a)
 Unary plus.
big_float operator- (const big_float &a)
 Unary minus.
big_float add (const big_float &b, const big_float &c, long prec, int mode)
big_float add (const big_float &b, const big_float &c, long prec)
big_float add (const big_float &b, const big_float &c)
big_float sub (const big_float &b, const big_float &c, long prec, int mode)
big_float sub (const big_float &b, const big_float &c, long prec)
big_float sub (const big_float &b, const big_float &c)
big_float mul (const big_float &b, const big_float &c, long prec, int mode)
big_float mul (const big_float &b, const big_float &c, long prec)
big_float mul (const big_float &b, const big_float &c)
big_float div (const big_float &b, const big_float &c, long prec, int mode)
big_float div (const big_float &b, const big_float &c, long prec)
big_float div (const big_float &b, const big_float &c)
big_float divnu (const big_float &b, const big_float &c, long prec, int mode)
big_float div_i (const big_int &c)
big_float fsqrt (const big_float &b, long prec, int mode)
big_float fsqrt (const big_float &b, long prec)
big_float fsqrt (const big_float &b)
big_float nfsqrt (const big_float &b, long prec, int mode)
big_float operator+ (const big_float &b, const big_float &c)
 Binary plus. It is equivalent to add(b, c).
big_float operator- (const big_float &b, const big_float &c)
 Binary minus. It is equivalent to sub(b, c).
big_float operator * (const big_float &b, const big_float &c)
 Multiplication. It is equivalent to mul(b, c).
big_float operator/ (const big_float &b, const big_float &c)
 Divizion. It is equivalent to div(b, c).
big_floatoperator+= (big_float &b, const big_float &c)
 Combined assignment-addition operator.
big_floatoperator-= (big_float &b, const big_float &c)
 Combined assignment-subtraction operator.
big_floatoperator *= (big_float &b, const big_float &c)
 Combined assignment-multiplication operator.
big_floatoperator/= (big_float &b, const big_float &c)
 Combined assignment-division operator.
big_float ceil (const big_float &a)
 Returns the next bigger integer.
big_float floor (const big_float &a)
 Returns the next smaller integer.
big_float frac (const big_float &a)
 Returns the fractal part of the number.
big_int iceil (const big_float &a)
 Returns the next bigger integer.
big_int ifloor (const big_float &a)
 Returns the next smaller integer.
big_float frandom (long bits)
 Returns random number in the interval 0 <=x < 1 with prec lenght of mantissa.
big_float frandom ()
 Returns random number in the interval 0 <=x < 1 with prec lenght of mantissa.
big_float frandom1 (long bits, const big_int &exp=0)
 Returns random number with prec lenght of mantissa and with exp as exponent.


Detailed Description

Definition at line 82 of file big_float.hpp.


Constructor & Destructor Documentation

Arageli::big_float::big_float (  ) 

Constructor.

Definition at line 343 of file big_float.cpp.

Arageli::big_float::big_float ( const char *  str  ) 

Converts str to a big_float.

Definition at line 355 of file big_float.cpp.

Arageli::big_float::big_float ( const big_float b  ) 

Makes a copy of a number.

Definition at line 348 of file big_float.cpp.

Arageli::big_float::big_float ( const big_int s,
const big_int e 
)

Definition at line 362 of file big_float.cpp.

Arageli::big_float::big_float ( double  b  ) 

Converts b to a big number.

see notes above

Definition at line 371 of file big_float.cpp.

Arageli::big_float::big_float ( int  i  ) 

Converts b to a big number.

Definition at line 391 of file big_float.cpp.

Arageli::big_float::~big_float (  ) 

Destructor.

Definition at line 397 of file big_float.cpp.


Member Function Documentation

big_int Arageli::big_float::get_exponent (  )  const

Returns the exponent.

Definition at line 331 of file big_float.cpp.

big_int Arageli::big_float::get_significant (  )  const

Returns the significant.

Definition at line 337 of file big_float.cpp.

void Arageli::big_float::in ( std::istream &  ins,
char  c = 'd' 
)

Input number.

Definition at line 928 of file big_float.cpp.

int Arageli::big_float::is_Inf (  ) 

returns 1 iff the number is +Infinity or -Infinity

Definition at line 1342 of file big_float.cpp.

int Arageli::big_float::is_mInf (  ) 

returns 1 iff the number is -Infinity

int Arageli::big_float::is_mZero (  ) 

returns 1 iff the number is -0

Definition at line 1331 of file big_float.cpp.

int Arageli::big_float::is_NaN (  ) 

returns 1 iff the number is NaN

Definition at line 1317 of file big_float.cpp.

int Arageli::big_float::is_pInf (  ) 

returns 1 iff the number is +Infinity

int Arageli::big_float::is_pZero (  ) 

returns 1 iff the number is +0

Definition at line 1326 of file big_float.cpp.

int Arageli::big_float::is_Special (  ) 

returns 1 iff the number is Nan, Infinity or 0

Definition at line 1336 of file big_float.cpp.

int Arageli::big_float::is_Zero (  ) 

returns 1 iff the number is +0 or -0

Definition at line 1321 of file big_float.cpp.

big_float & Arageli::big_float::operator= ( const int  i  ) 

Assignment

Definition at line 434 of file big_float.cpp.

big_float & Arageli::big_float::operator= ( const char *  str  ) 

Assignment.

Definition at line 439 of file big_float.cpp.

big_float & Arageli::big_float::operator= ( const double  d  ) 

Assignment.

see notes above

Definition at line 410 of file big_float.cpp.

big_float & Arageli::big_float::operator= ( const big_float b  ) 

Assignment.

Definition at line 402 of file big_float.cpp.

void Arageli::big_float::out ( std::ostream &  os,
char  c = 'd' 
) const

Formated output.

Definition at line 946 of file big_float.cpp.

void Arageli::big_float::set_global_precision ( long  p  )  [static]

Sets the global precision to p.

Definition at line 485 of file big_float.cpp.

void Arageli::big_float::set_round_mode ( int  m = TO_NEAREST  )  [static]

Sets the global rounding mode.

Definition at line 492 of file big_float.cpp.


Friends And Related Function Documentation

big_float add ( const big_float b,
const big_float c 
) [friend]

Definition at line 538 of file big_float.cpp.

big_float add ( const big_float b,
const big_float c,
long  prec 
) [friend]

Definition at line 562 of file big_float.cpp.

big_float add ( const big_float b,
const big_float c,
long  prec,
int  mode 
) [friend]

Addition. Up to prec binary digits in rounding mode mode. The parameters prec and mode are optional and have the global defult values which can be set by set_global_precision and set_rounding_mode.

Definition at line 586 of file big_float.cpp.

big_float ceil ( const big_float a  )  [friend]

Returns the next bigger integer.

Definition at line 1128 of file big_float.cpp.

int cmp ( const big_float a,
const big_float b 
) [friend]

Compares two numbers.

Returns

Definition at line 447 of file big_float.cpp.

big_float div ( const big_float b,
const big_float c 
) [friend]

Definition at line 556 of file big_float.cpp.

big_float div ( const big_float b,
const big_float c,
long  prec 
) [friend]

Definition at line 580 of file big_float.cpp.

big_float div ( const big_float b,
const big_float c,
long  prec,
int  mode 
) [friend]

Divizion. Up to prec binary digits The parameters prec and mode are optional and have the global defult values which can be set by set_global_precision

Definition at line 714 of file big_float.cpp.

big_float div_i ( const big_int c  )  [friend]

Definition at line 759 of file big_float.cpp.

big_float divnu ( const big_float b,
const big_float c,
long  prec,
int  mode 
) [friend]

Definition at line 731 of file big_float.cpp.

big_float floor ( const big_float a  )  [friend]

Returns the next smaller integer.

Definition at line 1150 of file big_float.cpp.

big_float frac ( const big_float a  )  [friend]

Returns the fractal part of the number.

Definition at line 1173 of file big_float.cpp.

big_float frandom (  )  [friend]

Returns random number in the interval 0 <=x < 1 with prec lenght of mantissa.

Definition at line 1305 of file big_float.cpp.

big_float frandom ( long  bits  )  [friend]

Returns random number in the interval 0 <=x < 1 with prec lenght of mantissa.

Definition at line 1299 of file big_float.cpp.

big_float frandom1 ( long  bits,
const big_int exp = 0 
) [friend]

Returns random number with prec lenght of mantissa and with exp as exponent.

Definition at line 1310 of file big_float.cpp.

big_float fsqrt ( const big_float b  )  [friend]

Definition at line 1228 of file big_float.cpp.

big_float fsqrt ( const big_float b,
long  prec 
) [friend]

Definition at line 1235 of file big_float.cpp.

big_float fsqrt ( const big_float b,
long  prec,
int  mode 
) [friend]

Square rooting. Up to prec binary digits The parameters prec and mode are optional and have the global defult values which can be set by set_global_precision.

Definition at line 1240 of file big_float.cpp.

big_int iceil ( const big_float a  )  [friend]

Returns the next bigger integer.

Definition at line 1187 of file big_float.cpp.

big_int ifloor ( const big_float a  )  [friend]

Returns the next smaller integer.

Definition at line 1208 of file big_float.cpp.

big_float mul ( const big_float b,
const big_float c 
) [friend]

Definition at line 550 of file big_float.cpp.

big_float mul ( const big_float b,
const big_float c,
long  prec 
) [friend]

Definition at line 574 of file big_float.cpp.

big_float mul ( const big_float b,
const big_float c,
long  prec,
int  mode 
) [friend]

Multiplication. Up to prec binary digits in rounding mode mode The parameters prec and mode are optional and have the global defult values which can be set by set_global_precision and set_rounding_mode.

Definition at line 668 of file big_float.cpp.

big_float nfsqrt ( const big_float b,
long  prec,
int  mode 
) [friend]

Definition at line 1271 of file big_float.cpp.

big_float operator * ( const big_float b,
const big_float c 
) [friend]

Multiplication. It is equivalent to mul(b, c).

Definition at line 526 of file big_float.cpp.

big_float& operator *= ( big_float b,
const big_float c 
) [friend]

Combined assignment-multiplication operator.

Definition at line 255 of file big_float.hpp.

int operator!= ( const big_float a,
const big_float b 
) [friend]

Test for inequality.

Definition at line 458 of file big_float.cpp.

big_float operator+ ( const big_float b,
const big_float c 
) [friend]

Binary plus. It is equivalent to add(b, c).

Definition at line 514 of file big_float.cpp.

big_float operator+ ( const big_float a  )  [friend]

Unary plus.

Definition at line 499 of file big_float.cpp.

big_float& operator+= ( big_float b,
const big_float c 
) [friend]

Combined assignment-addition operator.

Definition at line 249 of file big_float.hpp.

big_float operator- ( const big_float b,
const big_float c 
) [friend]

Binary minus. It is equivalent to sub(b, c).

Definition at line 520 of file big_float.cpp.

big_float operator- ( const big_float a  )  [friend]

Unary minus.

Definition at line 505 of file big_float.cpp.

big_float& operator-= ( big_float b,
const big_float c 
) [friend]

Combined assignment-subtraction operator.

Definition at line 252 of file big_float.hpp.

big_float operator/ ( const big_float b,
const big_float c 
) [friend]

Divizion. It is equivalent to div(b, c).

Definition at line 532 of file big_float.cpp.

big_float& operator/= ( big_float b,
const big_float c 
) [friend]

Combined assignment-division operator.

Definition at line 258 of file big_float.hpp.

int operator< ( const big_float a,
const big_float b 
) [friend]

Test for less.

Definition at line 473 of file big_float.cpp.

std::ostream& operator<< ( std::ostream &  s,
const big_float x 
) [friend]

Reads a number.

Definition at line 914 of file big_float.cpp.

int operator<= ( const big_float a,
const big_float b 
) [friend]

Test for less than or equal to.

Definition at line 478 of file big_float.cpp.

int operator== ( const big_float a,
const big_float b 
) [friend]

Test for equality.

Definition at line 453 of file big_float.cpp.

int operator> ( const big_float a,
const big_float b 
) [friend]

Test for greater.

Definition at line 463 of file big_float.cpp.

int operator>= ( const big_float a,
const big_float b 
) [friend]

Test for greater than or equal to.

Definition at line 468 of file big_float.cpp.

std::istream& operator>> ( std::istream &  s,
big_float x 
) [friend]

Writes a number.

Definition at line 826 of file big_float.cpp.

big_float sub ( const big_float b,
const big_float c 
) [friend]

Definition at line 544 of file big_float.cpp.

big_float sub ( const big_float b,
const big_float c,
long  prec 
) [friend]

Definition at line 568 of file big_float.cpp.

big_float sub ( const big_float b,
const big_float c,
long  prec,
int  mode 
) [friend]

Subtraction. Up to prec binary digits in rounding mode mode The parameters prec and mode are optional and have the global defult values which can be set by set_global_precision and set_rounding_mode.

Definition at line 659 of file big_float.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Aug 31 17:38:22 2006 for Arageli by  doxygen 1.4.7