plll  1.0
plll::arithmetic::Real Class Reference

Represents an arbitrary precision floating point value. More...

#include <arithmetic-gmp.hpp>

Classes

struct  PrecisionInit
 

Public Types

typedef RealContext Context
 The context type.
 

Public Member Functions

long getApproxExponent () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns approximate e such that |x| is approximately $2^e$. More...
 
Realoperator= (const Real &r)
 Assigns the given floating point number r to this floating point number. More...
 
template<class A , template< typename, typename > class O>
Realoperator= (const expressions::Expression< RealContext, A, O > &E)
 Assigns the floating point expression E to this floating point number. More...
 
unsigned long precision () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Retrieves the precision of this floating point number. More...
 
 Real ()
 Creates a new floating point number. More...
 
 Real (const RealContext &rc)
 Creates a real with the precision given by the context. More...
 
 Real (const Real &r, bool clone=true)
 Creates a copy of the given floating point number. More...
 
 Real (const Real &r, const RealContext &rc)
 Creates a copy of the given floating point number with the given context's precision. More...
 
 Real (long i)
 Creates a new floating point number from the given native integer. More...
 
 Real (long i, const RealContext &rc)
 Creates a new floating point number from the given native integer with the given context's precision. More...
 
 Real (unsigned long i)
 Creates a new floating point number from the given native integer. More...
 
 Real (unsigned long i, const RealContext &rc)
 Creates a new floating point number from the given native integer with the given context's precision. More...
 
 Real (long long i)
 Creates a new floating point number from the given native integer. More...
 
 Real (long long i, const RealContext &rc)
 Creates a new floating point number from the given native integer with the given context's precision. More...
 
 Real (double d)
 Creates a new floating point number from the given native floating point number. More...
 
 Real (double d, const RealContext &rc)
 Creates a new floating point number from the given native floating point number with the given context's precision. More...
 
 Real (long double d)
 Creates a new floating point number from the given native floating point number. More...
 
 Real (long double d, const RealContext &rc)
 Creates a new floating point number from the given native floating point number with the given context's precision. More...
 
 Real (const Integer &i)
 Creates a new floating point number from the given arbitrary precision integer. More...
 
 Real (const Integer &i, const RealContext &rc)
 Creates a new floating point number from the given arbitrary precision integer with the given context's precision. More...
 
template<class A , template< typename, typename > class O>
 Real (const expressions::Expression< RealContext, A, O > &E)
 Creates a floating point number from the given floating point expression. More...
 
template<class A , template< typename, typename > class O>
 Real (const expressions::Expression< RealContext, A, O > &E, const RealContext &rc)
 Creates a floating point number from the given floating point expression and Real context. More...
 
void setContext (const RealContext &rc)
 Adjusts the precision of this floating point number to the given context's precision. More...
 
 ~Real () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Releases the memory used by the arbitrary precision floating point number.
 

Friends

void abs (Real &r, const Real &a)
 Takes the absolute value of a and stores the result in r. More...
 
void acos (Real &res, const Real &a)
 Computes the arccosine of a and stores the result in res. More...
 
void add (Real &r, const Real &a, const Real &b)
 Adds a and b and stores the result in r. More...
 
void addmul (Real &r, const Real &a, const Real &b)
 Multiplies a and b and adds the result to r. More...
 
void asin (Real &res, const Real &a)
 Computes the arcsine of a and stores the result in res. More...
 
void atan (Real &res, const Real &a)
 Computes the arctangent of a and stores the result in res. More...
 
void atan2 (Real &res, const Real &y, const Real &x)
 Computes the arctangent of $\tfrac{y}{x}$and stores the result inres. The signs ofxandy` are used to determine the quadrant and yield a result in $[-\pi, \pi]$. More...
 
int compare (const Real &a, const Real &b)
 Compares the two floating point numbers. More...
 
int compareAbsValues (const Real &a, const Real &b)
 Compares the two floating point numbers in absolute value. More...
 
void cos (Real &res, const Real &a)
 Computes the cosine of a and stores the result in res. More...
 
void decrement (Real &r, const Real &a)
 Decrements a by one and stores the result in r. More...
 
void div (Real &r, const Real &a, const Real &b)
 Divides a by b and stores the result in r. More...
 
void divmod (Real &q, Real &r, const Real &a, const Real &b)
 Stores quotient and remainder of the division of a by b in q respectively r. More...
 
void exp (Real &res, const Real &a)
 Computes the exponential function at a and stores the result in res. More...
 
void gamma (Real &res, const Real &a)
 Computes the Gamma function at a and stores the result in res. More...
 
void increment (Real &r, const Real &a)
 Increments a by one and stores the result in r. More...
 
bool isNegative (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being strictly negative. More...
 
bool isNonNegative (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being positive or zero. More...
 
bool isNonPositive (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being negative or zero. More...
 
bool isOne (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being one. More...
 
bool isPositive (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being strictly positive. More...
 
bool isZero (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being zero. More...
 
void lgamma (Real &res, const Real &a)
 Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res. More...
 
void lgamma (Real &res, int &sign, const Real &a)
 Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res. The sign of the Gamma function at a is stored in sign. More...
 
void log (Real &res, const Real &a)
 Computes the natural logarithm of a and stores the result in res. More...
 
void log10 (Real &res, const Real &a)
 Computes the logarithm of a to base 10 and stores the result in res. More...
 
void log2 (Real &res, const Real &a)
 Computes the logarithm of a to base 2 and stores the result in res. More...
 
void makeAbs (Real &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Makes the operand non-negative. More...
 
void mod (Real &r, const Real &a, const Real &b)
 Takes the remainder of the division of a by b and stores it in r. More...
 
void mul (Real &r, const Real &a, const Real &b)
 Multiplies a with b and stores the result in r. More...
 
void neg (Real &r, const Real &a)
 Negates a and stores the result in r. More...
 
bool operator!= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b for inequality. More...
 
bool operator< (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
std::ostream & operator<< (std::ostream &s, const Real &r)
 Outputs the floating point number on the given output stream.
 
bool operator<= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool operator== (const Real &a, const Real &b)
 Compares the two floating point numbers a and b for equality. More...
 
bool operator> (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool operator>= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
std::istream & operator>> (std::istream &s, Real &r)
 Reads the floating point number from the given input stream.
 
void power (Real &res, const Real &a, const Integer &b)
 Raises a to the power b and stores the result in res. More...
 
void power (Real &res, const Real &a, const Real &b)
 Raises a to the power b and stores the result in res. More...
 
void setInfinity (Real &r, bool sign)
 Sets the given floating point number to $\pm \infty$. More...
 
void setNaN (Real &r)
 Sets the given floating point number to Not a Number.
 
void setOne (Real &r)
 Sets the given floating point number to one.
 
void setZero (Real &r, bool sign)
 Sets the given floating point number to $\pm 0$. More...
 
void shl (Real &r, const Real &a, const Real &b)
 Multiplies a by $2^b$ and stores the result in r. More...
 
void shl (Real &r, const Real &a, long b)
 Multiplies a by $2^b$ and stores the result in r. More...
 
void shr (Real &r, const Real &a, const Real &b)
 Multiplies a by $2^{-b}$ and stores the result in r. More...
 
void shr (Real &r, const Real &a, long b)
 Multiplies a by $2^{-b}$ and stores the result in r. More...
 
int sign (const Real &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the sign of the given floating point number. More...
 
void sin (Real &res, const Real &a)
 Computes the sine of a and stores the result in res. More...
 
void sqrt (Real &res, const Real &a)
 Computes the square root of a and stores the result in res. More...
 
void square (Real &r, const Real &a)
 Computes the square of a and stores the result in r. More...
 
void sub (Real &r, const Real &a, const Real &b)
 Subtracts b from a and stores the result in r. More...
 
void submul (Real &r, const Real &a, const Real &b)
 Multiplies a and b and subtracts the result from r. More...
 
void tan (Real &res, const Real &a)
 Computes the tangent of a and stores the result in res. More...
 

Detailed Description

Represents an arbitrary precision floating point value.

Definition at line 2036 of file arithmetic-gmp.hpp.

Constructor & Destructor Documentation

plll::arithmetic::Real::Real ( )
inline

Creates a new floating point number.

Warning
Default value is NaN and not zero!

Definition at line 2093 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( const RealContext rc)
inlineexplicit

Creates a real with the precision given by the context.

Parameters
rcA context.

Definition at line 2140 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( const Real r,
bool  clone = true 
)
inline

Creates a copy of the given floating point number.

Parameters
rThe floating point number to copy.
cloneIf true, creates a copy with the same precision. If false, creates a copy of the default precision.

Definition at line 2152 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( const Real r,
const RealContext rc 
)
inlineexplicit

Creates a copy of the given floating point number with the given context's precision.

Parameters
rThe floating point number to copy.
rcThe context whose precision to use for the result.

Definition at line 2170 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( long  i)
inlineexplicit

Creates a new floating point number from the given native integer.

Parameters
iThe native integer whose value to take.

Definition at line 2209 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( long  i,
const RealContext rc 
)
inlineexplicit

Creates a new floating point number from the given native integer with the given context's precision.

Parameters
iThe native integer whose value to take.
rcThe context whose precision to take.

Definition at line 2221 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( unsigned long  i)
inlineexplicit

Creates a new floating point number from the given native integer.

Parameters
iThe native integer whose value to take.

Definition at line 2232 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( unsigned long  i,
const RealContext rc 
)
inlineexplicit

Creates a new floating point number from the given native integer with the given context's precision.

Parameters
iThe native integer whose value to take.
rcThe context whose precision to take.

Definition at line 2244 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( long long  i)
inlineexplicit

Creates a new floating point number from the given native integer.

Parameters
iThe native integer whose value to take.

Definition at line 2255 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( long long  i,
const RealContext rc 
)
inlineexplicit

Creates a new floating point number from the given native integer with the given context's precision.

Parameters
iThe native integer whose value to take.
rcThe context whose precision to take.

Definition at line 2268 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( double  d)
inlineexplicit

Creates a new floating point number from the given native floating point number.

Parameters
dThe native floating point number whose value to take.

Definition at line 2280 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( double  d,
const RealContext rc 
)
inlineexplicit

Creates a new floating point number from the given native floating point number with the given context's precision.

Parameters
dThe native floating point number whose value to take.
rcThe context whose precision to take.

Definition at line 2292 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( long double  d)
inlineexplicit

Creates a new floating point number from the given native floating point number.

Parameters
dThe native floating point number whose value to take.

Definition at line 2304 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( long double  d,
const RealContext rc 
)
inlineexplicit

Creates a new floating point number from the given native floating point number with the given context's precision.

Parameters
dThe native floating point number whose value to take.
rcThe context whose precision to take.

Definition at line 2316 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( const Integer i)
inlineexplicit

Creates a new floating point number from the given arbitrary precision integer.

Parameters
iThe arbitrary precision integer whose value to take.

Definition at line 2328 of file arithmetic-gmp.hpp.

plll::arithmetic::Real::Real ( const Integer i,
const RealContext rc 
)
inlineexplicit

Creates a new floating point number from the given arbitrary precision integer with the given context's precision.

Parameters
iThe arbitrary precision integer whose value to take.
rcThe context whose precision to take.

Definition at line 2340 of file arithmetic-gmp.hpp.

template<class A , template< typename, typename > class O>
plll::arithmetic::Real::Real ( const expressions::Expression< RealContext, A, O > &  E)
inline

Creates a floating point number from the given floating point expression.

Parameters
EThe expression used to create this floating point number.

Definition at line 2352 of file arithmetic-gmp.hpp.

template<class A , template< typename, typename > class O>
plll::arithmetic::Real::Real ( const expressions::Expression< RealContext, A, O > &  E,
const RealContext rc 
)
inline

Creates a floating point number from the given floating point expression and Real context.

Parameters
EThe expression used to create this floating point number.
rcThe context whose precision to take.

Definition at line 2366 of file arithmetic-gmp.hpp.

Member Function Documentation

long plll::arithmetic::Real::getApproxExponent ( ) const
inline

Returns approximate e such that |x| is approximately $2^e$.

The value of e should be OK up to +-2.

Returns
$\approx \log_2 |x|$.

Definition at line 3215 of file arithmetic-gmp.hpp.

Real& plll::arithmetic::Real::operator= ( const Real r)
inline

Assigns the given floating point number r to this floating point number.

Parameters
rThe floating point number to assign to this floating point number.
Returns
A reference to this floating point number.

Definition at line 2378 of file arithmetic-gmp.hpp.

template<class A , template< typename, typename > class O>
Real& plll::arithmetic::Real::operator= ( const expressions::Expression< RealContext, A, O > &  E)
inline

Assigns the floating point expression E to this floating point number.

Parameters
EThe floating point expression.
Returns
A reference to this floating point number.

Definition at line 2395 of file arithmetic-gmp.hpp.

unsigned long plll::arithmetic::Real::precision ( ) const
inline

Retrieves the precision of this floating point number.

Returns
The precision in mantissa bits of the current floating point number.

Definition at line 2181 of file arithmetic-gmp.hpp.

void plll::arithmetic::Real::setContext ( const RealContext rc)
inline

Adjusts the precision of this floating point number to the given context's precision.

Parameters
rcA context whose precision to use.

Definition at line 2192 of file arithmetic-gmp.hpp.

Friends And Related Function Documentation

void abs ( Real r,
const Real a 
)
friend

Takes the absolute value of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2902 of file arithmetic-gmp.hpp.

void acos ( Real res,
const Real a 
)
friend

Computes the arccosine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3064 of file arithmetic-gmp.hpp.

void add ( Real r,
const Real a,
const Real b 
)
friend

Adds a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2444 of file arithmetic-gmp.hpp.

void addmul ( Real r,
const Real a,
const Real b 
)
friend

Multiplies a and b and adds the result to r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 2588 of file arithmetic-gmp.hpp.

void asin ( Real res,
const Real a 
)
friend

Computes the arcsine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3055 of file arithmetic-gmp.hpp.

void atan ( Real res,
const Real a 
)
friend

Computes the arctangent of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3073 of file arithmetic-gmp.hpp.

void atan2 ( Real res,
const Real y,
const Real x 
)
friend

Computes the arctangent of $\tfrac{y}{x}$and stores the result inres. The signs ofxandy` are used to determine the quadrant and yield a result in $[-\pi, \pi]$.

Parameters
resThe result.
yThe numerator of the fraction the function is evaluated at.
xThe denominator of the fraction the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3082 of file arithmetic-gmp.hpp.

int compare ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $a < b$, zero if $a = b$ and a positive number if $a > b$.

Definition at line 2950 of file arithmetic-gmp.hpp.

int compareAbsValues ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers in absolute value.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $|a| < |b|$, zero if $|a| = |b|$ and a positive number if $|a| > |b|$.

Definition at line 3002 of file arithmetic-gmp.hpp.

void cos ( Real res,
const Real a 
)
friend

Computes the cosine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3037 of file arithmetic-gmp.hpp.

void decrement ( Real r,
const Real a 
)
friend

Decrements a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2884 of file arithmetic-gmp.hpp.

void div ( Real r,
const Real a,
const Real b 
)
friend

Divides a by b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2693 of file arithmetic-gmp.hpp.

void divmod ( Real q,
Real r,
const Real a,
const Real b 
)
friend

Stores quotient and remainder of the division of a by b in q respectively r.

Parameters
qThe quotient.
rThe remainder.
aThe first operand.
bThe second operand.

Definition at line 2787 of file arithmetic-gmp.hpp.

void exp ( Real res,
const Real a 
)
friend

Computes the exponential function at a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3094 of file arithmetic-gmp.hpp.

void gamma ( Real res,
const Real a 
)
friend

Computes the Gamma function at a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Square Roots and Full Powers

Definition at line 3139 of file arithmetic-gmp.hpp.

void increment ( Real r,
const Real a 
)
friend

Increments a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2875 of file arithmetic-gmp.hpp.

bool isNegative ( const Real r)
friend

Tests the given plll::arithmetic::Real object for being strictly negative.

Returns
Returns true if and only if the argument is strictly negative.
See also
Predicates

Definition at line 2432 of file arithmetic-gmp.hpp.

bool isNonNegative ( const Real r)
friend

Tests the given plll::arithmetic::Real object for being positive or zero.

Returns
Returns true if and only if the argument is positive or zero.
See also
Predicates

Definition at line 2426 of file arithmetic-gmp.hpp.

bool isNonPositive ( const Real r)
friend

Tests the given plll::arithmetic::Real object for being negative or zero.

Returns
Returns true if and only if the argument is negative or zero.
See also
Predicates

Definition at line 2438 of file arithmetic-gmp.hpp.

bool isOne ( const Real r)
friend

Tests the given plll::arithmetic::Real object for being one.

Returns
Returns true if and only if the argument is one.
See also
Predicates

Definition at line 2414 of file arithmetic-gmp.hpp.

bool isPositive ( const Real r)
friend

Tests the given plll::arithmetic::Real object for being strictly positive.

Returns
Returns true if and only if the argument is strictly positive.
See also
Predicates

Definition at line 2420 of file arithmetic-gmp.hpp.

bool isZero ( const Real r)
friend

Tests the given plll::arithmetic::Real object for being zero.

Returns
Returns true if and only if the argument is zero.
See also
Predicates

Definition at line 2408 of file arithmetic-gmp.hpp.

void lgamma ( Real res,
const Real a 
)
friend

Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Special Functions

Definition at line 3148 of file arithmetic-gmp.hpp.

void lgamma ( Real res,
int &  sign,
const Real a 
)
friend

Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res. The sign of the Gamma function at a is stored in sign.

Parameters
resThe result.
signWill be set to 1 if $\Gamma(a) \ge 0$ and -1 otherwise.
See also
Special Functions
Parameters
aThe value the function is evaluated at.

Definition at line 3158 of file arithmetic-gmp.hpp.

void log ( Real res,
const Real a 
)
friend

Computes the natural logarithm of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3103 of file arithmetic-gmp.hpp.

void log10 ( Real res,
const Real a 
)
friend

Computes the logarithm of a to base 10 and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3121 of file arithmetic-gmp.hpp.

void log2 ( Real res,
const Real a 
)
friend

Computes the logarithm of a to base 2 and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3112 of file arithmetic-gmp.hpp.

void makeAbs ( Real a)
friend

Makes the operand non-negative.

Parameters
aThe operand.

Definition at line 2911 of file arithmetic-gmp.hpp.

void mod ( Real r,
const Real a,
const Real b 
)
friend

Takes the remainder of the division of a by b and stores it in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2775 of file arithmetic-gmp.hpp.

void mul ( Real r,
const Real a,
const Real b 
)
friend

Multiplies a with b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2641 of file arithmetic-gmp.hpp.

void neg ( Real r,
const Real a 
)
friend

Negates a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2893 of file arithmetic-gmp.hpp.

bool operator!= ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers a and b for inequality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a does not equal b.

Definition at line 944 of file arithmetic-gmp-rops.hpp.

bool operator< ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is less than b.

Definition at line 980 of file arithmetic-gmp-rops.hpp.

bool operator<= ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is less than or equal to b.

Definition at line 956 of file arithmetic-gmp-rops.hpp.

bool operator== ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers a and b for equality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a equals b.

Definition at line 932 of file arithmetic-gmp-rops.hpp.

bool operator> ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is greater than b.

Definition at line 992 of file arithmetic-gmp-rops.hpp.

bool operator>= ( const Real a,
const Real b 
)
friend

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is greater than or equal to b.

Definition at line 968 of file arithmetic-gmp-rops.hpp.

void power ( Real res,
const Real a,
const Integer b 
)
friend

Raises a to the power b and stores the result in res.

Parameters
resThe result.
aThe base.
bThe exponent.

Definition at line 3185 of file arithmetic-gmp.hpp.

void power ( Real res,
const Real a,
const Real b 
)
friend

Raises a to the power b and stores the result in res.

Parameters
resThe result.
aThe base.
bThe exponent.
See also
Square Roots and Full Powers

Definition at line 3194 of file arithmetic-gmp.hpp.

void setInfinity ( Real r,
bool  sign 
)
friend

Sets the given floating point number to $\pm \infty$.

Parameters
rThe floating point variable to set to infinity.
signIf true, the number is set to $+\infty$, and otherwise to $-\infty$. The default value is true.

Definition at line 2927 of file arithmetic-gmp.hpp.

void setZero ( Real r,
bool  sign 
)
friend

Sets the given floating point number to $\pm 0$.

Parameters
rThe floating point variable to set to zero.
signIf true, the number is set to $+0$, and otherwise to $-0$. The default value is true.

Definition at line 2932 of file arithmetic-gmp.hpp.

void shl ( Real r,
const Real a,
const Real b 
)
friend

Multiplies a by $2^b$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2825 of file arithmetic-gmp.hpp.

void shl ( Real r,
const Real a,
long  b 
)
friend

Multiplies a by $2^b$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.
See also
Square Roots and Full Powers

Definition at line 2857 of file arithmetic-gmp.hpp.

void shr ( Real r,
const Real a,
const Real b 
)
friend

Multiplies a by $2^{-b}$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.
See also
Square Roots and Full Powers

Definition at line 2841 of file arithmetic-gmp.hpp.

void shr ( Real r,
const Real a,
long  b 
)
friend

Multiplies a by $2^{-b}$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2866 of file arithmetic-gmp.hpp.

int sign ( const Real r)
friend

Returns the sign of the given floating point number.

Returns
Returns a negative value if the value is negative, 0 if it is zero, and a positive value if it is positive.
See also
Predicates

Definition at line 3013 of file arithmetic-gmp.hpp.

void sin ( Real res,
const Real a 
)
friend

Computes the sine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3028 of file arithmetic-gmp.hpp.

void sqrt ( Real res,
const Real a 
)
friend

Computes the square root of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3130 of file arithmetic-gmp.hpp.

void square ( Real r,
const Real a 
)
friend

Computes the square of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 3019 of file arithmetic-gmp.hpp.

void sub ( Real r,
const Real a,
const Real b 
)
friend

Subtracts b from a and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2496 of file arithmetic-gmp.hpp.

void submul ( Real r,
const Real a,
const Real b 
)
friend

Multiplies a and b and subtracts the result from r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 2614 of file arithmetic-gmp.hpp.

void tan ( Real res,
const Real a 
)
friend

Computes the tangent of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3046 of file arithmetic-gmp.hpp.


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