|
The mi_fp_argscale() accessor function obtains the scale of an argument of a user-defined routine from its associated MI_FPARAM structure.
fparam_ptr | is a pointer to the associated MI_FPARAM structure. |
arg_pos | is the index position into the argument-scale array for the argument whose scale you want. |
The mi_fp_argscale() function obtains the scale of the routine argument at position arg_pos from the MI_FPARAM structure that fparam_ptr references. The scale is an attribute of the data type. The meaning of the scale depends on the associated data type, as the following table shows.
If you call mi_fp_argscale() on some other data type, the function returns zero (0).
The MI_FPARAM structure stores information about the scale of routine arguments in the zero-based argument-scale array. To obtain information about the nth argument, use an arg_pos value of n-1.
For example, the following call to mi_fp_argscale() obtains the scale for the third argument of the my_func() UDR, with which fparam1 is associated:
>=0 | is the scale, in number of digits, of the fixed-point or floating-point argument at position arg_pos. |
MI_ERROR | indicates that the function was not successful. |
See the descriptions of the following functions: mi_fp_argisnull(), mi_fp_arglen(), mi_fp_argprec(), mi_fp_argtype(), mi_fp_retscale(), mi_fp_setargscale(), and mi_fp_setretscale().
For more information about the scale of a fixed-point data type, see
Chapter 3, Using Numeric Data Types.