Utils.uint64_ScaleIntRound

Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision. num must be non-negative and denom must be positive.

class Utils
static
ulong
uint64_ScaleIntRound
(
ulong val
,
int num
,
int denom
)

Parameters

val ulong

guint64 (such as a GstClockTime) to scale.

num int

numerator of the scale factor.

denom int

denominator of the scale factor.

Return Value

Type: ulong

val * num / denom. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded to the nearest integer (half-way cases are rounded up). See also gst_util_uint64_scale_int(), gst_util_uint64_scale_int_ceil(), gst_util_uint64_scale(), gst_util_uint64_scale_round(), gst_util_uint64_scale_ceil().

Meta