copy_bit_field


copy_bit_field(i1, start, end, i2)
      

Return the integer i1 with n bits from start (inclusive) to end (exclusive) replaced by the low-order n bits of the integer i2.

Examples:


number_to_string(copy_bit_field(0b10000, 0, 3, 0b10101), 2)
// 10101
number_to_string(copy_bit_field(0b00000, 1, 4, 0b10111), 2)
// 1110
      

Also see:

bshift
rotate_bit_field
reverse_bit_field


Core Module Index | Contents