Function sub [src]

r = a - b r, a and b may be aliases. Returns an error if memory could not be allocated.

Prototype

pub fn sub(r: *Managed, a: *const Managed, b: *const Managed) !void

Parameters

r: *Manageda: *const Managedb: *const Managed

Source

pub fn sub(r: *Managed, a: *const Managed, b: *const Managed) !void { try r.ensureCapacity(@max(a.len(), b.len()) + 1); var m = r.toMutable(); m.sub(a.toConst(), b.toConst()); r.setMetadata(m.positive, m.len); }