Replace Math128 with GncInt128, add GncRational to Doxygen docs.

This commit is contained in:
John Ralls 2015-10-31 16:27:51 -07:00
parent 089817a9f6
commit fdc9a6a199
3 changed files with 17 additions and 13 deletions

View File

@ -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
@ -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.
* *

View File

@ -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:

View File

@ -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