Function subWrap [src]

r = a - b with 2s-complement wrapping semantics. Returns whether any overflow occurred. r, a and b may be aliases. Returns an error if memory could not be allocated.

Prototype

pub fn subWrap( r: *Managed, a: *const Managed, b: *const Managed, signedness: Signedness, bit_count: usize, ) Allocator.Error!bool

Parameters

r: *Manageda: *const Managedb: *const Managedsignedness: Signednessbit_count: usize

Source

pub fn subWrap( r: *Managed, a: *const Managed, b: *const Managed, signedness: Signedness, bit_count: usize, ) Allocator.Error!bool { try r.ensureTwosCompCapacity(bit_count); var m = r.toMutable(); const wrapped = m.subWrap(a.toConst(), b.toConst(), signedness, bit_count); r.setMetadata(m.positive, m.len); return wrapped; }