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
.
number_to_string(copy_bit_field(0b10000, 0, 3, 0b10101), 2)
// 10101
number_to_string(copy_bit_field(0b00000, 1, 4, 0b10111), 2)
// 1110