Home > Backend Development > PHP Tutorial > 关于位演算

关于位演算

WBOY
Release: 2016-06-13 10:36:22
Original
901 people have browsed it

关于位运算
const AAA = 0x01 ;
const BBB = 0x02 ;
我定义了2个常量,怎么按位保存?
求高手指点,对于位运算一值很迷糊。

------解决方案--------------------
不明白你的 怎么按位保存 是指什么?
------解决方案--------------------

探讨

我想要的结果是,取出AAA的值为1,取出BBB的值为0,坐等高手讲解~~自己顶个

------解决方案--------------------
3 & 1 = 1
3 & 2 = 2

2 & 1 = 0
2 & 2 = 2


------解决方案--------------------
不理解

难道是 self::BBB & self::AAA;???结果倒是0了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template