GnuCash  5.6-133-gc519490283+
Functions
Gnc_numeric_arithmetic_operators

Normal arithmetic operators. More...

Functions

GncNumeric operator+ (GncNumeric a, GncNumeric b)
 
GncNumeric operator+ (GncNumeric a, int64_t b)
 
GncNumeric operator+ (int64_t a, GncNumeric b)
 
GncNumeric operator- (GncNumeric a, GncNumeric b)
 
GncNumeric operator- (GncNumeric a, int64_t b)
 
GncNumeric operator- (int64_t a, GncNumeric b)
 
GncNumeric operator* (GncNumeric a, GncNumeric b)
 
GncNumeric operator* (GncNumeric a, int64_t b)
 
GncNumeric operator* (int64_t a, GncNumeric b)
 
GncNumeric operator/ (GncNumeric a, GncNumeric b)
 
GncNumeric operator/ (GncNumeric a, int64_t b)
 
GncNumeric operator/ (int64_t a, GncNumeric b)
 

Detailed Description

Normal arithmetic operators.

The class arithmetic operators are implemented in terms of these operators. They use GncRational operators internally then call the GncNumeric(GncRational&) constructor which will silently round half-down to obtain int64_t members.

These operators can throw std::overflow_error, std::underflow_error, or std::invalid argument as indicated in the class GncNumeric documentation.

Parameters
aThe right-side operand
bThe left-side operand
Returns
A GncNumeric computed from the operation.