Function copy [src]
Copies the value of the integer to an existing Managed so that they both have the same value.
Extra memory will be allocated if the receiver does not have enough capacity.
Prototype
pub fn copy(self: *Managed, other: Const) !void
Parameters
self: *Managed
other: Const
Source
pub fn copy(self: *Managed, other: Const) !void {
if (self.limbs.ptr == other.limbs.ptr) return;
try self.ensureCapacity(other.limbs.len);
@memcpy(self.limbs[0..other.limbs.len], other.limbs[0..other.limbs.len]);
self.setMetadata(other.positive, other.limbs.len);
}