When to use Bitwise Operators during webdevelopment?

后端 未结 10 1299
Happy的楠姐
Happy的楠姐 2020-12-12 12:01

Although I grasp the concept of Bitwise Operators, I can\'t say that I have come across many use cases during the webdevelopment process at which I had to resort to using Bi

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 12:15

    Generally, you don't need to concern about operations at the bit level. You can think in bytes, ints, doubles, and other higher level data types. But there are times when you'd like to be able to go to the level of an individual bit.

    One of the most common utilization cases of the bitwise operators are the flags (php example). The bitwise operators are also used in binary file IO operations.

提交回复
热议问题