signExtend

fun Int.signExtend(bits: Int): Int

Takes nbits of this, and extends the last bit, creating a plain Int in one's complement


fun Long.signExtend(bits: Int): Long

Takes nbits of this, and extends the last bit, creating a plain Long in one's complement