native.U16
Native methods on U16.
All modules · Writing docstrings
to_int
Section titled “to_int”func to_int(self: U16): IntConvert to an arbitrary-precision Int without losing value.
func hash(self: U16): U64Return the runtime hash. Hash values are not a stable serialization format.
func band(self: U16, other: U16): U16Apply bitwise & to two values of the same fixed-width integer type.
func ior(self: U16, other: U16): U16Apply bitwise | to two values of the same fixed-width integer type.
func xor(self: U16, other: U16): U16Apply bitwise ^ to two values of the same fixed-width integer type.
func inv(self: U16): U16Invert every bit, retaining the same fixed-width integer type.
func shl(self: U16, count: Int): U16Shift by a nonnegative count representable as U32. The count wraps modulo the integer width; signed right shifts extend the sign bit.
func shr(self: U16, count: Int): U16Shift by a nonnegative count representable as U32. The count wraps modulo the integer width; signed right shifts extend the sign bit.