Function divTrunc [src]
q = a / b (rem r)
a / b are truncated (rounded towards -inf).
q may alias with a or b.
Asserts there is enough memory to store q and r.
The upper bound for r limb count is b.limbs.len.
The upper bound for q limb count is given by a.limbs.len.
limbs_buffer is used for temporary storage. The amount required is given by calcDivLimbsBufferLen.
Prototype
pub fn divTrunc( q: *Mutable, r: *Mutable, a: Const, b: Const, limbs_buffer: []Limb, ) void
Parameters
q: *Mutable
r: *Mutable
a: Const
b: Const
limbs_buffer: []Limb
Source
pub fn divTrunc(
q: *Mutable,
r: *Mutable,
a: Const,
b: Const,
limbs_buffer: []Limb,
) void {
const sep = a.limbs.len + 2;
var x = a.toMutable(limbs_buffer[0..sep]);
var y = b.toMutable(limbs_buffer[sep..]);
div(q, r, &x, &y);
}