mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Replace Math128 with GncInt128, add GncRational to Doxygen docs.
This commit is contained in:
parent
089817a9f6
commit
fdc9a6a199
@ -45,8 +45,9 @@ extern "C"
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
//using std::string;
|
//using std::string;
|
||||||
|
/** @addtogroup GncInt128
|
||||||
/**
|
* @ingroup QOF
|
||||||
|
* @{
|
||||||
* @brief provides a 128-bit int as a base class for GncNumeric.
|
* @brief provides a 128-bit int as a base class for GncNumeric.
|
||||||
*
|
*
|
||||||
* All the usual operators are provided. Only the explicit integer
|
* All the usual operators are provided. Only the explicit integer
|
||||||
@ -64,9 +65,9 @@ class GncInt128
|
|||||||
uint64_t m_lo;
|
uint64_t m_lo;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const unsigned int numlegs = 2;
|
static const unsigned int numlegs = 2;
|
||||||
static const unsigned int legbits = 64;
|
static const unsigned int legbits = 64;
|
||||||
static const unsigned int maxbits = legbits * numlegs;
|
static const unsigned int maxbits = legbits * numlegs;
|
||||||
|
|
||||||
enum // Values for m_flags
|
enum // Values for m_flags
|
||||||
{
|
{
|
||||||
@ -75,14 +76,16 @@ enum // Values for m_flags
|
|||||||
overflow = 2,
|
overflow = 2,
|
||||||
NaN = 4
|
NaN = 4
|
||||||
};
|
};
|
||||||
/**
|
/** @addtogroup Constructors Constructors
|
||||||
* Construct a GncInt128 from two int64_t.
|
* Constructors are templated so that a GncInt128 can be constructed from any
|
||||||
*
|
* arbitrary integer type or pair of integer types.
|
||||||
* N.B.: If the two parameters are of differing sign, it's taken to
|
* @note If the two parameters are of differing sign, it's taken to
|
||||||
* mean that the lower magnitude is *reducing* the magnitude of the
|
* mean that the lower magnitude is *reducing* the magnitude of the
|
||||||
* upper, so the lower magnitude will be subracted from UINT64_MAX to
|
* upper, so the lower magnitude will be subracted from UINT64_MAX to
|
||||||
* obtain the lower limb value.
|
* obtain the lower limb value.
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
/** Default constructor. Makes 0. */
|
||||||
GncInt128();
|
GncInt128();
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GncInt128(T lower) : GncInt128 {INT64_C(0), static_cast<int64_t>(lower)}
|
GncInt128(T lower) : GncInt128 {INT64_C(0), static_cast<int64_t>(lower)}
|
||||||
@ -119,6 +122,7 @@ enum // Values for m_flags
|
|||||||
|
|
||||||
GncInt128 (int64_t upper, uint64_t lower, unsigned char flags = '\0');
|
GncInt128 (int64_t upper, uint64_t lower, unsigned char flags = '\0');
|
||||||
GncInt128 (uint64_t upper, uint64_t lower, unsigned char flags = '\0');
|
GncInt128 (uint64_t upper, uint64_t lower, unsigned char flags = '\0');
|
||||||
|
/** @} */
|
||||||
/**
|
/**
|
||||||
* Clear the object.
|
* Clear the object.
|
||||||
*
|
*
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
|
|
||||||
struct GncDenom;
|
struct GncDenom;
|
||||||
|
|
||||||
|
/** @ingroup QOF
|
||||||
|
* @brief Rational number class using GncInt128 for the numerator and denominator.
|
||||||
|
*/
|
||||||
|
|
||||||
class GncRational
|
class GncRational
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -38,10 +38,6 @@
|
|||||||
@addtogroup KVP KVP: Key-Value Pairs
|
@addtogroup KVP KVP: Key-Value Pairs
|
||||||
@ingroup QOF
|
@ingroup QOF
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
@addtogroup Math128 Math128: 128-bit Integer Math Library
|
|
||||||
@ingroup QOF
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
@addtogroup Numeric Numeric: Rational Number Handling w/ Rounding Error Control
|
@addtogroup Numeric Numeric: Rational Number Handling w/ Rounding Error Control
|
||||||
@ingroup QOF
|
@ingroup QOF
|
||||||
|
Loading…
Reference in New Issue
Block a user