Algorithm for copying N bits at arbitrary position from one int to another

前端 未结 7 1783
别那么骄傲
别那么骄傲 2021-01-31 21:36

An interesting problem I\'ve been pondering the past few days is how to copy one integer\'s bits into another integer at a given position in the destination integer. So, for exa

7条回答
  •  悲哀的现实
    2021-01-31 22:10

    I think it hardly could be more efficient. Moreover, bitwise operations are much faster than any algebraic operations.

提交回复
热议问题