Function bitCountTwosComp [src]

Returns the number of bits required to represent the integer in twos-complement form. If the integer is negative the value returned is the number of bits needed by a signed integer to represent the value. If positive the value is the number of bits for an unsigned integer. Any unsigned integer will fit in the signed integer with bitcount one greater than the returned value. e.g. -127 returns 8 as it will fit in an i8. 127 returns 7 since it fits in a u7.

Prototype

pub fn bitCountTwosComp(self: Managed) usize

Parameters

self: Managed

Source

pub fn bitCountTwosComp(self: Managed) usize { return self.toConst().bitCountTwosComp(); }