PreviousNext

utc_multime(3dts)

Multiplies a relative binary timestamp by an integer factor

Synopsis

#include <dce/utc.h>

int utc_multime(
utc_t *result,
utc_t *
utc1,
long
factor);

Parameters

Input

utc1
Relative binary timestamp.

factor
Integer scale factor.

Output

result
Resulting relative binary timestamp.

Description
The utc_multime( ) routine multiplies a relative binary timestamp by an integer. Either or both may be negative; the resulting binary timestamp has the appropriate sign. The unsigned inaccuracy in the binary timestamp is also multiplied by the absolute value of the integer.

Return Values
~0 Indicates that the routine executed successfully.

1 Indicates an invalid time argument or invalid results.

Examples
The following example scales a relative time by an integral value and prints the result.

utc_t relutc, scaledutc;
char timstr[UTC_MAX_STR_LEN];
/* Assume relutc contains the time to scale. Scale it by a factor
* of 17 ...
*/
utc_multime(&scaledutc, /* Out: Scaled rel time */
&relutc, /* In: Rel time to scale */
17L); /* In: Scale factor */
utc_ascreltime(timstr, /* Out: ASCII rel time */
UTC_MAX_STR_LEN, /* In: Input buffer length */
&scakedutc); /* In: Rel time to convert */
printf("Scaled result is %s\n", timstr);

Related Information
Function: utc_mulftime(3dts)