Checking for result overflow

The call interface checks for results which do not fit into the specified size of result field, or which overflow into the sign bit when signed variables are used.

If a result field ( counter_value , minimum_value or maximum_value ) has been defined as a signed variable by specifying value_length as a negative value, the call interface checks for results that overflow into the sign bit. In this case, the operation completes normally but the return code NC_RESULT_OVERFLOW is set. As a special case, a result value for a counter which is at its limit value is not checked for this form of overflow, to avoid setting the return code unnecessarily. This means that if a query is made to a counter which is at its limit, and whose maximum value is the maximum positive value, a negative number might be returned as the current counter value without causing this return code.

If a result field ( counter_value , minimum_value or maximum_value ) is too short to contain the full non-zero part of the result, the operation completes normally, but one of the following return codes is set:
  • NC_RESULT_CARRY, if the leading part is exactly equal to 1.
  • NC_RESULT_TRUNCATED, if the leading part is greater than 1.
If a 4–byte unsigned counter that has a maximum of high values has reached its limit value, the return code NC_RESULT_CARRY is set, and the counter value is zero.


dfhp3wx.html | Timestamp icon Last updated: Monday, 5 June 2017