opendp 0.14.2

A library of differential privacy algorithms for the statistical analysis of sensitive private data.
Documentation
1
2
3
4
5
6
7
8
9
# type: ignore
def x_mul_2k(x: RBig, k: i32) -> RBig:
    num, den = x.into_parts()  # |\label{line:into-parts}|
    if k < 0:
        den <<= cast(-k, usize)
    else:
        num <<= cast(k, usize)

    return RBig.from_parts(num, den)