我的问题是为什么a>>1换位符号,但不是(a & 0xaaaaaaaa) >> 1?
代码段
int a = 0xaaaaaaaa;
std::cout << sizeof(a) << std::endl;
getBits(a);
std::cout << sizeof(a>>1) << std::endl;
getBits(a >> 1);
std::cout << sizeof(a & 0xaaaaaaaa) << std::endl;
getBits(a & 0xaaaaaaaa);
std::cout << sizeof((a & 0xaaaaaaaa)>>1) << std::endl;
getBits((a & 0xaaaaaaaa) >> 1);
Run Code Online (Sandbox Code Playgroud)
结果
4
10101010101010101010101010101010
4
11010101010101010101010101010101
4
10101010101010101010101010101010
4
01010101010101010101010101010101
Run Code Online (Sandbox Code Playgroud) Ubuntu 14.04 LTS
我知道传统方法正在使用sudo apt-cache search,但是此命令不是最佳方法。例如,如果我要搜索numpy,它将显示许多不相关的软件包,如下所示。我需要一个一个地搜索,有没有更好的方法?
.....
python3-tables-dbg - hierarchical database for Python 3 based on HDF5 (debug extension)
python3-tables-lib - hierarchical database for Python3 based on HDF5 (extension)
reinteract - Worksheet-based graphical Python shell
stimfit - Program for viewing and analyzing electrophysiological data
stimfit-dbg - Debug symbols for stimfit
texlive-lang-italian - TeX Live: Italian
python-spyderlib-doc - python IDE for scientists (Documentation)
python3-spyderlib - python IDE for scientists (Python 3)
spyder-common - python IDE for scientists (common files) …Run Code Online (Sandbox Code Playgroud)