Function rsmpeg::ffi::av_compare_mod[][src]

pub unsafe extern "C" fn av_compare_mod(a: u64, b: u64, mod_: u64) -> i64
Expand description

Compare the remainders of two integer operands divided by a common divisor.

In other words, compare the least significant log2(mod) bits of integers a and b.

@code{.c} av_compare_mod(0x11, 0x02, 0x10) < 0 // since 0x11 % 0x10 (0x1) < 0x02 % 0x10 (0x2) av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) > 0x02 % 0x20 (0x02) @endcode

@param a,b Operands @param mod Divisor; must be a power of 2 @return - a negative value if a % mod < b % mod - a positive value if a % mod > b % mod - zero if a % mod == b % mod