|
| SOQ () |
| Ctor.
|
|
| SOQ (const mpq_t p_q) |
| Ctor.
|
|
| SOQ (const __int128 p_num, const __int128 p_den) |
| Ctor.
|
|
| ~SOQ () |
| Dtor.
|
|
SOQ * | dup () const override |
| Creates a new instance as copy following the red book definition. More...
|
|
std::string | opequal () const override |
| For operators '=', 'cvs' and 'stack'. More...
|
|
OTCode | ot () const override |
| Returns an OTCode. More...
|
|
std::string | type () const override |
| Returns a type name. More...
|
|
bool | equal (const SO *p_other) const override |
| Equality. More...
|
|
bool | gt (const SO *p_other) const override |
| Greater than. More...
|
|
bool | ge (const SO *p_other) const override |
| Greater or equal. More...
|
|
void | getRational (mpq_t p_q) const |
| Set the parameter to our value.
|
|
void | setRational (const mpq_t p_q) |
| Replaces the rational by the parameter.
|
|
bool | getComponents (__int128 &p_num, __int128 &p_den) const |
| Set the parameters to numerator and denominator. More...
|
|
bool | isunitfraction () const |
| Checks numerator == 1.
|
|
void | divqr (mpq_t p_q, mpq_t p_r) const |
| Calculates quotient and remainder.
|
|
bool | parse (std::string p_str) |
| Parses the string for a presentation of a rational. More...
|
|
void | abs () |
| Inplace abs.
|
|
void | neg () |
| Inplace neg.
|
|
void | reciprocal () |
| Inplace reciprocal.
|
|
__float128 | flt128 () const |
| A real representation of the rational. More...
|
|
| SO (bool p_exec=false) |
| Ctor.
|
|
virtual | ~SO ()=default |
| Virtual dtor. More...
|
|
bool | getExec () const |
| Getter for exec_.
|
|
void | setExec (bool p_exec) |
| Setter for exec_.
|
|
virtual size_t | getSize () const |
| Getter for the number of characters or number of objects. More...
|
|
virtual SO * | dup () const =0 |
| Creates a new instance as copy following the red book definition. More...
|
|
virtual SO * | clone () const |
| Creates a new instance as copy with deep cloning. More...
|
|
virtual std::string | opequal () const =0 |
| For operators '=', 'cvs' and 'stack'. More...
|
|
virtual std::string | opequalequal () const |
| For operators '==' and 'pstack'. More...
|
|
virtual OTCode | ot () const =0 |
| Returns an OTCode. More...
|
|
virtual std::string | type () const =0 |
| Returns a type name. More...
|
|
virtual bool | equal (const SO *) const =0 |
| Equality. More...
|
|
virtual bool | gt (const SO *) const |
| Greater than. More...
|
|
virtual bool | ge (const SO *) const |
| Greater or equal. More...
|
|
| Counter (Counter< SO > &&)=delete |
|
Counter< SO > & | operator= (const Counter< SO > &)=delete |
|
Counter< SO > & | operator= (Counter< SO > &&)=delete |
|
Semantic Object Rational Number A multiple precicion rational number.
- Invariant
- denominator > 0
-
gcd of numerator and denominator == 1