Function subSat [src]

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

Prototype

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

Parameters

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

Source

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