pub fn add(r: *Managed, a: *const Managed, b: *const Managed) Allocator.Error!void
r = a + b
r, a and b may be aliases.
Returns an error if memory could not be allocated.
r: *Managed
a: *const Managed
b: *const Managed
3153 3154 3155 3156 3157 3158 3159 3160
pub fn add(r: *Managed, a: *const Managed, b: *const Managed) Allocator.Error!void { const needed = @max(a.len(), b.len()) + 1; const aliased = limbsAliasDistinct(r, a) or limbsAliasDistinct(r, b); try r.ensureAliasAwareCapacity(needed, aliased); var m = r.toMutable(); m.add(a.toConst(), b.toConst()); r.setMetadata(m.positive, m.len); }
r = a + b
r, a and b may be aliases.
Returns an error if memory could not be allocated.