decadd()

Adds two decimal values.

Syntax

mint decadd(dec_t *n1, struct decimal *n2, struct decimal *n3);
  1. n1 is a pointer to the decimal structure of the first operand.
  2. n2 is a pointer to the decimal structure of the second operand.
  3. n3 is a pointer to the decimal structure that contains the sum (n1 + n2).

Returns

Table 1. Return codes
Code Description
0 The operation was successful.
-1200 The operation resulted in overflow.
-1201 The operation resulted in underflow.