Function setTwosCompIntLimit [src]
Set self to either bound of a 2s-complement integer.
Note: The result is still sign-magnitude, not twos complement! In order to convert the
result to twos complement, it is sufficient to take the absolute value.
Prototype
pub fn setTwosCompIntLimit( r: *Managed, limit: TwosCompIntLimit, signedness: Signedness, bit_count: usize, ) !void
Parameters
r: *Managed
limit: TwosCompIntLimit
signedness: Signedness
bit_count: usize
Source
pub fn setTwosCompIntLimit(
r: *Managed,
limit: TwosCompIntLimit,
signedness: Signedness,
bit_count: usize,
) !void {
try r.ensureCapacity(calcTwosCompLimbCount(bit_count));
var m = r.toMutable();
m.setTwosCompIntLimit(limit, signedness, bit_count);
r.setMetadata(m.positive, m.len);
}