int kdatatype_cast_process(
int type1,
int type2,
int return_values)
none
proc_type = kdatatype_cast_process(type1, type2, KUBYTE | KDOUBLE);
Any number of data types can be specified. This routine will always try to return the data type that will not destroy data integrity. However, it will never return a data type not specified in return_values. It is up to the programmer to ensure that the data type specified by the return value either preserves the data integrity or handles the loss in data integrity properly.
For example, you would lose data integrity if you called this routine in the following manner :
proc_type = kdatatype_cast_process(KUBYTE, KSHORT, KUBYTE | KUSHORT);
Return_values = KUBYTE | KUSHORT, the returned value will be KUSHORT, but since KSHORT means that negative numbers are posible the data processing the data as KUSHORT will not not reflect this properly. The call should OR KINT or KLONG data type so that negative numbers are processed as negative numbers. However, as stated above it is up to the programmer to specify the return_values so that data integrity is preserved or handles this lose in there processing routine correctly.
If either of the types is KSTRING or KSTRUCT than KNONE is returned.
none
none
$BOOTSTRAP/objects/library/klibm/src/kdata_type.c