deccmp()

Compares two decimal values.

Syntax

mint deccmp(dec_t *n1, struct decimal *n2);
  1. n1 is a pointer to the decimal structure of the first number to compare.
  2. n2 is a pointer to the decimal structure of the second number to compare.

Returns

Table 1. Return codes
Code Description
0 The two values are identical.
1 The first value is greater than the second value.
-1 The first value is less than the second value.
-2 Either value is null.