AndroMeta  2.0.0
Public Member Functions | Static Public Member Functions
Meta::MReal Class Reference

Real number data type with arbitrary precision. More...

#include <MReal.h>

List of all members.

Public Member Functions

 MReal (const char *s)
 MReal (double x)
 MReal (int64_t x)
 MReal (int x)
 MReal (const MReal &r)
 MReal (const mrat &r)
MRealoperator= (const MReal &r)
MRealoperator+= (const MReal &r)
template<typename T >
MReal operator+ (const T &t) const
MReal operator+ (const MReal &x) const
MReal operator++ (int)
MRealoperator++ ()
MRealoperator-= (const MReal &r)
template<typename T >
MReal operator- (const T &t) const
MReal operator- (const MReal &x) const
MReal operator-- (int)
MRealoperator-- ()
MReal operator- () const
MRealoperator*= (const MReal &r)
template<typename T >
MReal operator* (const T &t) const
MReal operator* (const MReal &x) const
MRealoperator/= (const MReal &r)
template<typename T >
MReal operator/ (const T &t) const
MReal operator/ (const MReal &x) const
MRealoperator%= (const MReal &x)
template<typename T >
MReal operator% (const T &t) const
MReal operator% (const MReal &x) const
bool operator< (const MReal &x) const
template<typename T >
bool operator< (const T &t) const
bool operator> (const MReal &x) const
template<typename T >
bool operator> (const T &t) const
bool operator<= (const MReal &x) const
template<typename T >
bool operator<= (const T &t) const
bool operator>= (const MReal &x) const
template<typename T >
bool operator>= (const T &t) const
bool operator== (const MReal &x) const
template<typename T >
bool operator== (const T &t) const
bool operator!= (const MReal &x) const
template<typename T >
bool operator!= (const T &t) const
void setPrecision (size_t bits)
double toDouble () const
int64_t toLong () const
mrat toRat () const
MStr toStr (bool exp=true, int precision=-1) const

Static Public Member Functions

static void setDefaultPrecision (size_t bits)
static size_t defaultPrecision ()
static MReal fromStr (const MStr &str)
static MReal cos (const MReal &x)
static MReal sin (const MReal &x)
static MReal tan (const MReal &x)
static MReal acos (const MReal &x)
static MReal asin (const MReal &x)
static MReal atan (const MReal &x)
static MReal atan2 (const MReal &y, const MReal &x)
static MReal cosh (const MReal &x)
static MReal sinh (const MReal &x)
static MReal tanh (const MReal &x)
static MReal exp (const MReal &x)
static MReal log (const MReal &x)
static MReal log10 (const MReal &x)
static MReal pow (const MReal &base, const MReal &exponent)
static MReal sqrt (const MReal &x)
static MReal ceil (const MReal &x)
static MReal floor (const MReal &x)
static MReal abs (const MReal &x)
static MReal pi ()
static MReal euler ()
static MReal catalan ()

Detailed Description

Real number data type with arbitrary precision.

Provides arithemitc operators, standard math functions and conversion between other numeric types. The underlying implementation is provided by the GMP and MPFR libraries.


Constructor & Destructor Documentation

Meta::MReal::MReal ( const char *  s) [explicit]

Construct a real number from an extended C double-syntax string, e.g: "3.1415926535897932384626433832795028841971693993751058209749445923078", "-36091205165278380324368187046633e-14"


Member Function Documentation

static MReal Meta::MReal::abs ( const MReal x) [static]
Returns:
The absolute power of x.
static MReal Meta::MReal::acos ( const MReal x) [static]
Returns:
The arccosine of x.
static MReal Meta::MReal::asin ( const MReal x) [static]
Returns:
The arcsine of x.
static MReal Meta::MReal::atan ( const MReal x) [static]
Returns:
The arctangent of x.
static MReal Meta::MReal::atan2 ( const MReal y,
const MReal x 
) [static]
Returns:
The arctangent of x, 2*pi periodic.
static MReal Meta::MReal::catalan ( ) [static]
Returns:
The Catalan constant (in the default precision).
static MReal Meta::MReal::ceil ( const MReal x) [static]
Returns:
The ceiling of x.
static MReal Meta::MReal::cos ( const MReal x) [static]
Returns:
The cosine of x.
static MReal Meta::MReal::cosh ( const MReal x) [static]
Returns:
The hyperbolic cosine of v.
static MReal Meta::MReal::euler ( ) [static]
Returns:
Euler's constant (in the default precision).
static MReal Meta::MReal::exp ( const MReal x) [static]
Returns:
The exponential of x.
static MReal Meta::MReal::floor ( const MReal x) [static]
Returns:
The floor of x.
static MReal Meta::MReal::log ( const MReal x) [static]
Returns:
The log of x (base e).
static MReal Meta::MReal::log10 ( const MReal x) [static]
Returns:
The log of x, base 10.
static MReal Meta::MReal::pi ( ) [static]
Returns:
The constant pi (in the default precision).
static MReal Meta::MReal::pow ( const MReal base,
const MReal exponent 
) [static]
Returns:
base raised to exponent.
static void Meta::MReal::setDefaultPrecision ( size_t  bits) [static]

Set the default precision for subsequently created MReal's. Initially the default is determined by the MProgram argument "mPrecision".

void Meta::MReal::setPrecision ( size_t  bits)

Set the precision for this MReal.

static MReal Meta::MReal::sin ( const MReal x) [static]
Returns:
The sine of x.
static MReal Meta::MReal::sinh ( const MReal x) [static]
Returns:
The hyperbolic sine of v.
static MReal Meta::MReal::sqrt ( const MReal x) [static]
Returns:
The square root of x.
static MReal Meta::MReal::tan ( const MReal x) [static]
Returns:
The tangent of x.
static MReal Meta::MReal::tanh ( const MReal x) [static]
Returns:
The hyperbolic tangent of v.
MStr Meta::MReal::toStr ( bool  exp = true,
int  precision = -1 
) const

Convert this MReal to a string in base 10.

Parameters:
exptrue to use exponent/scientific notation if applicable.
precisionThe number of base 10 precision digits. -1 to use full precision.

The documentation for this class was generated from the following file: