Function bitOr [src]
r = a | b under 2s complement semantics.
r may alias with a or b.
a and b are zero-extended to the longer of a or b.
Asserts that r has enough limbs to store the result. Upper bound is @max(a.limbs.len, b.limbs.len).
Prototype
pub fn bitOr(r: *Mutable, a: Const, b: Const) void
Parameters
r: *Mutable
a: Const
b: Const
Source
pub fn bitOr(r: *Mutable, a: Const, b: Const) void {
// Trivial cases, llsignedor does not support zero.
if (a.eqlZero()) {
r.copy(b);
return;
} else if (b.eqlZero()) {
r.copy(a);
return;
}
if (a.limbs.len >= b.limbs.len) {
r.positive = llsignedor(r.limbs, a.limbs, a.positive, b.limbs, b.positive);
r.normalize(if (b.positive) a.limbs.len else b.limbs.len);
} else {
r.positive = llsignedor(r.limbs, b.limbs, b.positive, a.limbs, a.positive);
r.normalize(if (a.positive) b.limbs.len else a.limbs.len);
}
}