#include <rational_number.hpp>
◆ RationalNumber() [1/2]
hsc_snippets::RationalNumber::RationalNumber |
( |
const RationalNumber & | other | ) |
|
|
default |
◆ RationalNumber() [2/2]
hsc_snippets::RationalNumber::RationalNumber |
( |
RationalNumber && | other | ) |
|
|
defaultnoexcept |
◆ abs()
◆ create() [1/2]
Creates a RationalNumber with the given numerator and a denominator of 1.
- Parameters
-
nominator | The numerator of the rational number. |
- Returns
- A RationalNumber representing nominator/1.
◆ create() [2/2]
Creates a RationalNumber with the given numerator and denominator.
- Parameters
-
nominator | The numerator of the rational number. |
denominator | The denominator of the rational number. Must not be zero. |
- Returns
- A RationalNumber representing nominator/denominator.
- Exceptions
-
std::invalid_argument | if the denominator is zero. |
◆ getDenominator()
const BigInteger & hsc_snippets::RationalNumber::getDenominator |
( |
| ) |
const |
|
inlinenodiscard |
◆ getNominator()
const BigInteger & hsc_snippets::RationalNumber::getNominator |
( |
| ) |
const |
|
inlinenodiscard |
◆ inverse()
◆ negate()
◆ one()
◆ operator!=()
bool hsc_snippets::RationalNumber::operator!= |
( |
const RationalNumber & | other | ) |
const |
|
inline |
◆ operator*()
◆ operator*=()
◆ operator+()
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator-=()
◆ operator/()
◆ operator/=()
◆ operator<()
bool hsc_snippets::RationalNumber::operator< |
( |
const RationalNumber & | other | ) |
const |
|
inline |
◆ operator<=()
bool hsc_snippets::RationalNumber::operator<= |
( |
const RationalNumber & | other | ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool hsc_snippets::RationalNumber::operator== |
( |
const RationalNumber & | other | ) |
const |
|
inline |
◆ operator>()
bool hsc_snippets::RationalNumber::operator> |
( |
const RationalNumber & | other | ) |
const |
|
inline |
◆ operator>=()
bool hsc_snippets::RationalNumber::operator>= |
( |
const RationalNumber & | other | ) |
const |
|
inline |
◆ to_string()
std::string hsc_snippets::RationalNumber::to_string |
( |
| ) |
const |
|
inlinenodiscard |
◆ zero()
The documentation for this class was generated from the following file: