Utils.uint64ScaleCeil

Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision.

This function can potentially be very slow if val and num are both greater than G_MAXUINT32.

struct Utils
static
ulong
uint64ScaleCeil
(
ulong val
,
ulong num
,
ulong denom
)

Parameters

val ulong

the number to scale

num ulong

the numerator of the scale ratio

denom ulong

the denominator of the scale ratio

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 up. See also gst_util_uint64_scale(), gst_util_uint64_scale_round(), gst_util_uint64_scale_int(), gst_util_uint64_scale_int_round(), gst_util_uint64_scale_int_ceil().