#include <big_float.hpp>
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_float & | operator= (const big_float &b) |
Assignment. | |
big_float & | operator= (const double d) |
Assignment. | |
big_float & | operator= (const char *str) |
Assignment. | |
big_float & | operator= (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_float & | operator+= (big_float &b, const big_float &c) |
Combined assignment-addition operator. | |
big_float & | operator-= (big_float &b, const big_float &c) |
Combined assignment-subtraction operator. | |
big_float & | operator *= (big_float &b, const big_float &c) |
Combined assignment-multiplication operator. | |
big_float & | operator/= (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. |
Definition at line 82 of file big_float.hpp.
Arageli::big_float::big_float | ( | ) |
Arageli::big_float::big_float | ( | const char * | str | ) |
Arageli::big_float::big_float | ( | const big_float & | b | ) |
Definition at line 362 of file big_float.cpp.
Arageli::big_float::big_float | ( | double | b | ) |
Arageli::big_float::big_float | ( | int | i | ) |
Arageli::big_float::~big_float | ( | ) |
big_int Arageli::big_float::get_exponent | ( | ) | const |
big_int Arageli::big_float::get_significant | ( | ) | const |
void Arageli::big_float::in | ( | std::istream & | ins, | |
char | c = 'd' | |||
) |
int Arageli::big_float::is_Inf | ( | ) |
int Arageli::big_float::is_mInf | ( | ) |
returns 1 iff the number is -Infinity
int Arageli::big_float::is_mZero | ( | ) |
int Arageli::big_float::is_NaN | ( | ) |
int Arageli::big_float::is_pInf | ( | ) |
returns 1 iff the number is +Infinity
int Arageli::big_float::is_pZero | ( | ) |
int Arageli::big_float::is_Special | ( | ) |
int Arageli::big_float::is_Zero | ( | ) |
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 | ) |
big_float & Arageli::big_float::operator= | ( | const double | d | ) |
void Arageli::big_float::out | ( | std::ostream & | os, | |
char | c = 'd' | |||
) | const |
void Arageli::big_float::set_global_precision | ( | long | p | ) | [static] |
void Arageli::big_float::set_round_mode | ( | int | m = TO_NEAREST |
) | [static] |
Definition at line 538 of file big_float.cpp.
Definition at line 562 of file big_float.cpp.
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.
Compares two numbers.
Returns
Definition at line 447 of file big_float.cpp.
Definition at line 556 of file big_float.cpp.
Definition at line 580 of file big_float.cpp.
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.
Definition at line 759 of file big_float.cpp.
Definition at line 731 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.
Returns random number with prec lenght of mantissa and with exp as exponent.
Definition at line 1310 of file big_float.cpp.
Definition at line 1228 of file big_float.cpp.
Definition at line 1235 of file big_float.cpp.
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.
Definition at line 550 of file big_float.cpp.
Definition at line 574 of file big_float.cpp.
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.
Definition at line 1271 of file big_float.cpp.
std::ostream& operator<< | ( | std::ostream & | s, | |
const big_float & | x | |||
) | [friend] |
std::istream& operator>> | ( | std::istream & | s, | |
big_float & | x | |||
) | [friend] |
Definition at line 544 of file big_float.cpp.
Definition at line 568 of file big_float.cpp.
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.