libqalculate-0.9.8

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Number Class Reference

A number. More...

`#include <Number.h>`

## Public Member Functions
| Number ()
| Number (string number, const ParseOptions &po=default_parse_options)
| Number (int numerator, int denominator=1, int exp_10=0)
| Number (const Number &o)
void | set (string number, const ParseOptions &po=default_parse_options)
void | set (int numerator, int denominator=1, int exp_10=0)
void | setInfinity ()
void | setPlusInfinity ()
void | setMinusInfinity ()
void | setFloat (double d_value)
void | setInternal (const mpz_t &mpz_value)
void | setInternal (const mpq_t &mpq_value)
void | setInternal (const mpf_t &mpf_value)
void | setInternal (const cln::cl_N &cln_value)
void | setImaginaryPart (const Number &o)
void | setImaginaryPart (int numerator, int denominator=1, int exp_10=0)
void | set (const Number &o)
void | clear ()
const cln::cl_N & | internalNumber () const
const mpz_t & | internalInteger () const
const mpq_t & | internalRational () const
const mpf_t & | internalFloat () const
const NumberType & | internalType () const
double | floatValue () const
int | intValue (bool *overflow=NULL) const
bool | isApproximate () const
bool | isApproximateType () const
void | setApproximate (bool is_approximate=true)
int | precision () const
void | setPrecision (int prec)
bool | isUndefined () const
bool | isInfinite () const
bool | isInfinity () const
bool | isPlusInfinity () const
bool | isMinusInfinity () const
Number | realPart () const
Number | imaginaryPart () const
Number | numerator () const
Number | denominator () const
Number | complexNumerator () const
Number | complexDenominator () const
void | operator= (const Number &o)
void | operator-- (int)
void | operator++ (int)
Number | operator- () const
Number | operator* (const Number &o) const
Number | operator/ (const Number &o) const
Number | operator+ (const Number &o) const
Number | operator- (const Number &o) const
Number | operator^ (const Number &o) const
Number | operator&& (const Number &o) const
Number | operator|| (const Number &o) const
Number | operator! () const
void | operator*= (const Number &o)
void | operator/= (const Number &o)
void | operator+= (const Number &o)
void | operator-= (const Number &o)
void | operator^= (const Number &o)
bool | operator== (const Number &o) const
bool | operator!= (const Number &o) const
bool | bitAnd (const Number &o)
bool | bitOr (const Number &o)
bool | bitXor (const Number &o)
bool | bitNot ()
bool | bitEqv (const Number &o)
bool | shiftLeft (const Number &o)
bool | shiftRight (const Number &o)
bool | shift (const Number &o)
bool | hasRealPart () const
bool | hasImaginaryPart () const
bool | isComplex () const
bool | isInteger () const
Number | integer () const
bool | isRational () const
bool | isReal () const
bool | isFraction () const
bool | isZero () const
bool | isOne () const
bool | isTwo () const
bool | isI () const
bool | isMinusI () const
bool | isMinusOne () const
bool | isNegative () const
bool | isNonNegative () const
bool | isPositive () const
bool | isNonPositive () const
bool | realPartIsNegative () const
bool | realPartIsPositive () const
bool | imaginaryPartIsNegative () const
bool | imaginaryPartIsPositive () const
bool | hasNegativeSign () const
bool | hasPositiveSign () const
bool | equalsZero () const
bool | equals (const Number &o) const
bool | equalsApproximately (const Number &o, int prec) const
ComparisonResult | compare (const Number &o) const
ComparisonResult | compareApproximately (const Number &o, int prec=EQUALS_PRECISION_LOWEST) const
ComparisonResult | compareImaginaryParts (const Number &o) const
ComparisonResult | compareRealParts (const Number &o) const
bool | isGreaterThan (const Number &o) const
bool | isLessThan (const Number &o) const
bool | isGreaterThanOrEqualTo (const Number &o) const
bool | isLessThanOrEqualTo (const Number &o) const
bool | isEven () const
bool | denominatorIsEven () const
bool | denominatorIsTwo () const
bool | numeratorIsEven () const
bool | numeratorIsOne () const
bool | numeratorIsMinusOne () const
bool | isOdd () const
int | integerLength () const
bool | add (const Number &o)
bool | subtract (const Number &o)
bool | multiply (const Number &o)
bool | divide (const Number &o)
bool | recip ()
bool | raise (const Number &o, bool try_exact=true)
bool | exp10 (const Number &o)
bool | exp2 (const Number &o)
bool | exp10 ()
bool | exp2 ()
bool | square ()
bool | negate ()
void | setNegative (bool is_negative)
bool | abs ()
bool | signum ()
bool | round (const Number &o)
bool | floor (const Number &o)
bool | ceil (const Number &o)
bool | trunc (const Number &o)
bool | mod (const Number &o)
bool | isqrt ()
bool | round ()
bool | floor ()
bool | ceil ()
bool | trunc ()
bool | frac ()
bool | rem (const Number &o)
bool | smod (const Number &o)
bool | irem (const Number &o)
bool | irem (const Number &o, Number &q)
bool | iquo (const Number &o)
bool | iquo (const Number &o, Number &r)
int | getBoolean () const
void | toBoolean ()
void | setTrue (bool is_true=true)
void | setFalse ()
void | setLogicalNot ()
void | e ()
void | pi ()
void | catalan ()
void | euler ()
bool | zeta ()
bool | sin ()
bool | asin ()
bool | sinh ()
bool | asinh ()
bool | cos ()
bool | acos ()
bool | cosh ()
bool | acosh ()
bool | tan ()
bool | atan ()
bool | tanh ()
bool | atanh ()
bool | ln ()
bool | log (const Number &o)
bool | exp ()
bool | lambertW ()
bool | gcd (const Number &o)
bool | lcm (const Number &o)
bool | factorial ()
bool | multiFactorial (const Number &o)
bool | doubleFactorial ()
bool | binomial (const Number &m, const Number &k)
bool | factorize (vector< Number > &factors)
bool | add (const Number &o, MathOperation op)
string | printNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | printDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | printImaginaryNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | printImaginaryDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | print (const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const
| Number ()
| Number (string number, const ParseOptions &po=default_parse_options)
| Number (int numerator, int denominator=1, int exp_10=0)
| Number (const Number &o)
void | set (string number, const ParseOptions &po=default_parse_options)
void | set (int numerator, int denominator=1, int exp_10=0)
void | setInfinity ()
void | setPlusInfinity ()
void | setMinusInfinity ()
void | setFloat (double d_value)
void | setInternal (const cln::cl_N &cln_value)
void | setImaginaryPart (const Number &o)
void | setImaginaryPart (int numerator, int denominator=1, int exp_10=0)
void | set (const Number &o)
void | clear ()
const cln::cl_N & | internalNumber () const
double | floatValue () const
int | intValue (bool *overflow=NULL) const
bool | isApproximate () const
bool | isApproximateType () const
void | setApproximate (bool is_approximate=true)
int | precision () const
void | setPrecision (int prec)
bool | isUndefined () const
bool | isInfinite () const
bool | isInfinity () const
bool | isPlusInfinity () const
bool | isMinusInfinity () const
Number | realPart () const
Number | imaginaryPart () const
Number | numerator () const
Number | denominator () const
Number | complexNumerator () const
Number | complexDenominator () const
void | operator= (const Number &o)
void | operator-- (int)
void | operator++ (int)
Number | operator- () const
Number | operator* (const Number &o) const
Number | operator/ (const Number &o) const
Number | operator+ (const Number &o) const
Number | operator- (const Number &o) const
Number | operator^ (const Number &o) const
Number | operator&& (const Number &o) const
Number | operator|| (const Number &o) const
Number | operator! () const
void | operator*= (const Number &o)
void | operator/= (const Number &o)
void | operator+= (const Number &o)
void | operator-= (const Number &o)
void | operator^= (const Number &o)
bool | operator== (const Number &o) const
bool | operator!= (const Number &o) const
bool | bitAnd (const Number &o)
bool | bitOr (const Number &o)
bool | bitXor (const Number &o)
bool | bitNot ()
bool | bitEqv (const Number &o)
bool | shiftLeft (const Number &o)
bool | shiftRight (const Number &o)
bool | shift (const Number &o)
bool | hasRealPart () const
bool | hasImaginaryPart () const
bool | isComplex () const
bool | isInteger () const
Number | integer () const
bool | isRational () const
bool | isReal () const
bool | isFraction () const
bool | isZero () const
bool | isOne () const
bool | isTwo () const
bool | isI () const
bool | isMinusI () const
bool | isMinusOne () const
bool | isNegative () const
bool | isNonNegative () const
bool | isPositive () const
bool | isNonPositive () const
bool | realPartIsNegative () const
bool | realPartIsPositive () const
bool | imaginaryPartIsNegative () const
bool | imaginaryPartIsPositive () const
bool | hasNegativeSign () const
bool | hasPositiveSign () const
bool | equalsZero () const
bool | equals (const Number &o) const
bool | equalsApproximately (const Number &o, int prec) const
ComparisonResult | compare (const Number &o) const
ComparisonResult | compareApproximately (const Number &o, int prec=EQUALS_PRECISION_LOWEST) const
ComparisonResult | compareImaginaryParts (const Number &o) const
ComparisonResult | compareRealParts (const Number &o) const
bool | isGreaterThan (const Number &o) const
bool | isLessThan (const Number &o) const
bool | isGreaterThanOrEqualTo (const Number &o) const
bool | isLessThanOrEqualTo (const Number &o) const
bool | isEven () const
bool | denominatorIsEven () const
bool | denominatorIsTwo () const
bool | numeratorIsEven () const
bool | numeratorIsOne () const
bool | numeratorIsMinusOne () const
bool | isOdd () const
int | integerLength () const
bool | add (const Number &o)
bool | subtract (const Number &o)
bool | multiply (const Number &o)
bool | divide (const Number &o)
bool | recip ()
bool | raise (const Number &o, bool try_exact=true)
bool | exp10 (const Number &o)
bool | exp2 (const Number &o)
bool | exp10 ()
bool | exp2 ()
bool | square ()
bool | negate ()
void | setNegative (bool is_negative)
bool | abs ()
bool | signum ()
bool | round (const Number &o)
bool | floor (const Number &o)
bool | ceil (const Number &o)
bool | trunc (const Number &o)
bool | mod (const Number &o)
bool | isqrt ()
bool | round ()
bool | floor ()
bool | ceil ()
bool | trunc ()
bool | frac ()
bool | rem (const Number &o)
bool | smod (const Number &o)
bool | irem (const Number &o)
bool | irem (const Number &o, Number &q)
bool | iquo (const Number &o)
bool | iquo (const Number &o, Number &r)
int | getBoolean () const
void | toBoolean ()
void | setTrue (bool is_true=true)
void | setFalse ()
void | setLogicalNot ()
void | e ()
void | pi ()
void | catalan ()
void | euler ()
bool | zeta ()
bool | sin ()
bool | asin ()
bool | sinh ()
bool | asinh ()
bool | cos ()
bool | acos ()
bool | cosh ()
bool | acosh ()
bool | tan ()
bool | atan ()
bool | tanh ()
bool | atanh ()
bool | ln ()
bool | log (const Number &o)
bool | exp ()
bool | lambertW ()
bool | gcd (const Number &o)
bool | lcm (const Number &o)
bool | factorial ()
bool | multiFactorial (const Number &o)
bool | doubleFactorial ()
bool | binomial (const Number &m, const Number &k)
bool | factorize (vector< Number > &factors)
bool | add (const Number &o, MathOperation op)
string | printNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | printDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | printImaginaryNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | printImaginaryDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string | print (const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const

## Protected Member Functions
void | removeFloatZeroPart ()
void | testApproximate ()
void | testInteger ()
void | setPrecisionAndApproximateFrom (const Number &o)
void | removeFloatZeroPart ()
void | testApproximate ()
void | testInteger ()
void | setPrecisionAndApproximateFrom (const Number &o)

## Protected Attributes
mpz_t | i_value
mpq_t | r_value
mpf_t | f_value
NumberType | n_type
cln::cl_N | value
bool | b_inf
bool | b_pinf
bool | b_minf
bool | b_approx
int | i_precision

## Detailed Description

A number.

Can be rational, floating point, complex or infinite. Has arbitrary precision (uses Calculator::precision()) and infinitely large rational numbers. Implimented using CLN numbers.

## Constructor & Destructor Documentation

## ◆ Number() [1/8]

Number::Number | ( |  | ) |

Constructs a number initialized as zero.

## ◆ Number() [2/8]

Number::Number | ( | string | number,
|  | const ParseOptions & | po = `default_parse_options`
| ) |  |

Constructs a number parsing a text string.

Parameters

  number | Text string to read number from.
  po | Options for parsing the text string.

## ◆ Number() [3/8]

Number::Number | ( | int | numerator,
|  | int | denominator = `1`,
|  | int | exp_10 = `0`
| ) |  |

Constructs a rational number.

Parameters

  numerator |
  denominator |
  exp_10 |

## ◆ Number() [4/8]

Number::Number | ( | const Number & | o | ) |

Constructs a copy of a number.

## ◆ Number() [5/8]

Number::Number | ( |  | ) |

Constructs a number initialized as zero.

## ◆ Number() [6/8]

Number::Number | ( | string | number,
|  | const ParseOptions & | po = `default_parse_options`
| ) |  |

Constructs a number parsing a text string.

Parameters

  number | Text string to read number from.
  po | Options for parsing the text string.

## ◆ Number() [7/8]

Number::Number | ( | int | numerator,
|  | int | denominator = `1`,
|  | int | exp_10 = `0`
| ) |  |

Constructs a rational number.

Parameters

  numerator |
  denominator |
  exp_10 |

## ◆ Number() [8/8]

Number::Number | ( | const Number & | o | ) |

Constructs a copy of a number.

## Member Function Documentation

## ◆ add() [1/2]

bool Number::add | ( | const Number & | o | ) |

Add to the number (x+o).

Parameters

  o | Number to add.

Returns
  true if the operation was successful.

## ◆ add() [2/2]

bool Number::add | ( | const Number & | o | ) |

Add to the number (x+o).

Parameters

  o | Number to add.

Returns
  true if the operation was successful.

## ◆ catalan() [1/2]

void Number::catalan | ( |  | ) |

Set the number to Catalan's constant, calculated with the current default precision.

## ◆ catalan() [2/2]

void Number::catalan | ( |  | ) |

Set the number to Catalan's constant, calculated with the current default precision.

## ◆ divide() [1/2]

bool Number::divide | ( | const Number & | o | ) |

Divide the number (x/o).

Parameters

  o | Number to divide by.

Returns
  true if the operation was successful.

## ◆ divide() [2/2]

bool Number::divide | ( | const Number & | o | ) |

Divide the number (x/o).

Parameters

  o | Number to divide by.

Returns
  true if the operation was successful.

## ◆ e() [1/2]

void Number::e | ( |  | ) |

Set the number to e, the base of natural logarithm, calculated with the current default precision.

## ◆ e() [2/2]

void Number::e | ( |  | ) |

Set the number to e, the base of natural logarithm, calculated with the current default precision.

## ◆ euler() [1/2]

void Number::euler | ( |  | ) |

Set the number to Euler's constant, calculated with the current default precision.

## ◆ euler() [2/2]

void Number::euler | ( |  | ) |

Set the number to Euler's constant, calculated with the current default precision.

## ◆ exp10() [1/4]

bool Number::exp10 | ( | const Number & | o | ) |

Multiply the number with a power of ten (x*10^o).

Parameters

  o | Number to raise 10 by.

Returns
  true if the operation was successful.

## ◆ exp10() [2/4]

bool Number::exp10 | ( |  | ) |

Set the number to ten raised by the number (10^x).

Returns
  true if the operation was successful.

## ◆ exp10() [3/4]

bool Number::exp10 | ( | const Number & | o | ) |

Multiply the number with a power of ten (x*10^o).

Parameters

  o | Number to raise 10 by.

Returns
  true if the operation was successful.

## ◆ exp10() [4/4]

bool Number::exp10 | ( |  | ) |

Set the number to ten raised by the number (10^x).

Returns
  true if the operation was successful.

## ◆ exp2() [1/4]

bool Number::exp2 | ( | const Number & | o | ) |

Multiply the number with a power of two (x*2^o).

Parameters

  o | Number to raise 2 by.

Returns
  true if the operation was successful.

## ◆ exp2() [2/4]

bool Number::exp2 | ( |  | ) |

Set the number to two raised by the number (2^x).

Returns
  true if the operation was successful.

## ◆ exp2() [3/4]

bool Number::exp2 | ( | const Number & | o | ) |

Multiply the number with a power of two (x*2^o).

Parameters

  o | Number to raise 2 by.

Returns
  true if the operation was successful.

## ◆ exp2() [4/4]

bool Number::exp2 | ( |  | ) |

Set the number to two raised by the number (2^x).

Returns
  true if the operation was successful.

## ◆ imaginaryPart() [1/2]

Number Number::imaginaryPart | ( |  | ) | const

Returns the imaginary part as real number of the number if it is complex, or zero if it is real.

Returns
  true if the imaginary part of a complex number.

## ◆ imaginaryPart() [2/2]

Number Number::imaginaryPart | ( |  | ) | const

Returns the imaginary part as real number of the number if it is complex, or zero if it is real.

Returns
  true if the imaginary part of a complex number.

## ◆ intValue() [1/2]

int Number::intValue | ( | bool * | overflow = `NULL` | ) | const

Converts a number to an integer. If the number does not represent an integer it will rounded using round().

Parameters

  [out] | overflow | If overflow is non-null it will be set to true if the number was to large to fit in an int.

Returns
  Resulting integer.

## ◆ intValue() [2/2]

int Number::intValue | ( | bool * | overflow = `NULL` | ) | const

Converts a number to an integer. If the number does not represent an integer it will rounded using round().

Parameters

  [out] | overflow | If overflow is non-null it will be set to true if the number was to large to fit in an int.

Returns
  Resulting integer.

## ◆ isApproximate() [1/2]

bool Number::isApproximate | ( |  | ) | const

Returns true if the number is approximate.

Returns
  true if the number is approximate.

## ◆ isApproximate() [2/2]

bool Number::isApproximate | ( |  | ) | const

Returns true if the number is approximate.

Returns
  true if the number is approximate.

## ◆ isApproximateType() [1/2]

bool Number::isApproximateType | ( |  | ) | const

Returns true if the number has an approximate representation/is of approximate type – if it is a floating point number. Numbers of approximate type are always approximate, but the reversed relation is not always true.

Returns
  true if the number has an approximate representation.

## ◆ isApproximateType() [2/2]

bool Number::isApproximateType | ( |  | ) | const

Returns true if the number has an approximate representation/is of approximate type – if it is a floating point number. Numbers of approximate type are always approximate, but the reversed relation is not always true.

Returns
  true if the number has an approximate representation.

## ◆ isInfinite() [1/2]

bool Number::isInfinite | ( |  | ) | const

Returns true if the number is infinity, plus infinity or minus infinity.

Returns
  true if the number is infinite.

## ◆ isInfinite() [2/2]

bool Number::isInfinite | ( |  | ) | const

Returns true if the number is infinity, plus infinity or minus infinity.

Returns
  true if the number is infinite.

## ◆ isInfinity() [1/2]

bool Number::isInfinity | ( |  | ) | const

Returns true if the number is infinity, if the number is plus or minus infinity (which is not known).

Returns
  true if the number is infinity.

## ◆ isInfinity() [2/2]

bool Number::isInfinity | ( |  | ) | const

Returns true if the number is infinity, if the number is plus or minus infinity (which is not known).

Returns
  true if the number is infinity.

## ◆ isMinusInfinity() [1/2]

bool Number::isMinusInfinity | ( |  | ) | const

Returns true if the number is minus infinity.

Returns
  true if the number is minus infinity.

## ◆ isMinusInfinity() [2/2]

bool Number::isMinusInfinity | ( |  | ) | const

Returns true if the number is minus infinity.

Returns
  true if the number is minus infinity.

## ◆ isPlusInfinity() [1/2]

bool Number::isPlusInfinity | ( |  | ) | const

Returns true if the number is plus infinity.

Returns
  true if the number is plus infinity.

## ◆ isPlusInfinity() [2/2]

bool Number::isPlusInfinity | ( |  | ) | const

Returns true if the number is plus infinity.

Returns
  true if the number is plus infinity.

## ◆ multiply() [1/2]

bool Number::multiply | ( | const Number & | o | ) |

Multiply the number (x*o).

Parameters

  o | Number to multiply with.

Returns
  true if the operation was successful.

## ◆ multiply() [2/2]

bool Number::multiply | ( | const Number & | o | ) |

Multiply the number (x*o).

Parameters

  o | Number to multiply with.

Returns
  true if the operation was successful.

## ◆ negate() [1/2]

bool Number::negate | ( |  | ) |

Negate the number (-x).

Returns
  true if the operation was successful.

## ◆ negate() [2/2]

bool Number::negate | ( |  | ) |

Negate the number (-x).

Returns
  true if the operation was successful.

## ◆ pi() [1/2]

void Number::pi | ( |  | ) |

Set the number to pi, Archimede's constant, calculated with the current default precision.

## ◆ pi() [2/2]

void Number::pi | ( |  | ) |

Set the number to pi, Archimede's constant, calculated with the current default precision.

## ◆ precision() [1/2]

int Number::precision | ( |  | ) | const

Returns the.precision of the number.

Returns
  Precision of the number or -1 if the number is exact or the precision has not been set.

## ◆ precision() [2/2]

int Number::precision | ( |  | ) | const

Returns the.precision of the number.

Returns
  Precision of the number or -1 if the number is exact or the precision has not been set.

## ◆ raise() [1/2]

bool Number::raise | ( | const Number & | o,
|  | bool | try_exact = `true`
| ) |  |

Raise the number (x^o).

Parameters

  o | Number to raise to.
  try_exact | If an exact solution should be tried first (might be slow).

Returns
  true if the operation was successful.

## ◆ raise() [2/2]

bool Number::raise | ( | const Number & | o,
|  | bool | try_exact = `true`
| ) |  |

Raise the number (x^o).

Parameters

  o | Number to raise to.
  try_exact | If an exact solution should be tried first (might be slow).

Returns
  true if the operation was successful.

## ◆ realPart() [1/2]

Number Number::realPart | ( |  | ) | const

Returns the real part of the number if it is complex, or a copy if it is real.

Returns
  true if the real part of a complex number.

## ◆ realPart() [2/2]

Number Number::realPart | ( |  | ) | const

Returns the real part of the number if it is complex, or a copy if it is real.

Returns
  true if the real part of a complex number.

## ◆ recip() [1/2]

bool Number::recip | ( |  | ) |

Invert the number (1/x).

Returns
  true if the operation was successful.

## ◆ recip() [2/2]

bool Number::recip | ( |  | ) |

Invert the number (1/x).

Returns
  true if the operation was successful.

## ◆ setApproximate() [1/2]

void Number::setApproximate | ( | bool | is_approximate = `true` | ) |

Defines the number as approximate or exact. If a number of approximate type is set as exact, it will be converted to a rational number.

Parameters

  is_approximate | If the number shall be regarded as approximate.

## ◆ setApproximate() [2/2]

void Number::setApproximate | ( | bool | is_approximate = `true` | ) |

Defines the number as approximate or exact. If a number of approximate type is set as exact, it will be converted to a rational number.

Parameters

  is_approximate | If the number shall be regarded as approximate.

## ◆ square() [1/2]

bool Number::square | ( |  | ) |

Raise the number by two (x^2).

Returns
  true if the operation was successful.

## ◆ square() [2/2]

bool Number::square | ( |  | ) |

Raise the number by two (x^2).

Returns
  true if the operation was successful.

## ◆ subtract() [1/2]

bool Number::subtract | ( | const Number & | o | ) |

Subtracts from to the number (x-o).

Parameters

  o | Number to subtract.

Returns
  true if the operation was successful.

## ◆ subtract() [2/2]

bool Number::subtract | ( | const Number & | o | ) |

Subtracts from to the number (x-o).

Parameters

  o | Number to subtract.

Returns
  true if the operation was successful.

## ◆ zeta() [1/2]

bool Number::zeta | ( |  | ) |

Set the number to Riemann's zeta with the number as integral point. The number must be an integer greater than one.

Returns
  true if the calculation was successful.

## ◆ zeta() [2/2]

bool Number::zeta | ( |  | ) |

Set the number to Riemann's zeta with the number as integral point. The number must be an integer greater than one.

Returns
  true if the calculation was successful.

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

- libqalculate/Number-gmp.h
- libqalculate/Number.h