The invextend() function

The invextend() function copies an interval value under a different qualifier.

Extending is the operation of adding or dropping fields of an INTERVAL value to make it match a given qualifier. For INTERVAL values, both qualifiers must belong to the same interval class: either the year to month class or the day to fraction(5) class.

Syntax

mint invextend(in_inv, out_inv)
   intrvl_t *in_inv, *out_inv;
in_inv
A pointer to the interval value to extend.
out_inv
A pointer to an interval variable with a valid qualifier to use for the extension.

Usage

The invextend() function copies the qualifier-field digits of in_inv interval variable to the out_inv interval variable. The qualifier of the out_inv variable controls the copy.

The function discards any fields in in_inv that are to the right of the least-significant field in out_inv. The function fills in any fields in out_inv that are not present in in_inv as follows:
  • It fills the fields to the right of the least-significant field in in_inv with zeros.
  • It sets the fields to the left of the most-significant field in in_inv to valid interval values.

Return values

0
The conversion was successful.
<0
The conversion failed.
-1266
An interval value is incompatible with the operation.
-1268
A parameter contains an invalid interval qualifier.