Function reform::number::chinese_remainder[][src]

pub fn chinese_remainder(
    n1: Number,
    n2: Number,
    p1: Number,
    p2: Number
) -> Number

Use Garner's algorithm for the Chinese remainder theorem to reconstruct an x that satisfies n1 = x % p1 and n2 = x % p2. The x will be in the range [-p1p2/2,p1p2/2].