Have you ever had to use bit shifting in real projects?

后端 未结 30 3810
故里飘歌
故里飘歌 2020-12-02 05:35

Have you ever had to use bit shifting in real programming projects? Most (if not all) high level languages have shift operators in them, but when would you actually need to

30条回答
  •  情歌与酒
    2020-12-02 06:01

    Yes, bit shifting is being used at low-level embedded software all the time. It can also be used as an almost magic trick to perform extremely fast math operations, have a look at

    http://betterexplained.com/articles/understanding-quakes-fast-inverse-square-root/

提交回复
热议问题