Compare function.
More...
Compare function.
- Parameters
-
- Returns
- -1 if this < b, 0 if ==, 1 if this > b.
◆ cmp() [1/2]
Definition at line 607 of file gnc-numeric.cpp.
608{
609 if (m_den == b.
denom())
610 {
611 auto b_num = b.
num();
612 return m_num < b_num ? -1 : b_num < m_num ? 1 : 0;
613 }
615 return an.cmp(bn);
616}
int64_t denom() const noexcept
Accessor for denominator value.
int64_t num() const noexcept
Accessor for numerator value.
Rational number class using GncInt128 for the numerator and denominator.
◆ cmp() [2/2]
| int GncNumeric::cmp |
( |
int64_t |
b | ) |
|
|
inline |
Definition at line 266 of file gnc-numeric.hpp.
GncNumeric()
Default constructor provides the zero value.