当前位置:网站首页>Operator < <> > fool test case
Operator < <> > fool test case
2022-07-04 06:19:00 【A master of East and West】
Always remember : On the left is the operand , On the right yes Move digits ( This is the same for shift left and shift right )
public class Test {
// Start from the limit , Fool test
public static void main(String[] args) {
/*** Move left test ***/
// Operands Shift left arrow Shift left digit Binary system Decimal system
System.out.println(1 << 0); // 1 Moving to the left 0 position , 1 = 1
System.out.println(1 << 1); // 1 Moving to the left 1 position , 10 = 2
System.out.println(1 << 2); // 1 Moving to the left 2 position , 100 = 4
System.out.println(1 << 3); // 1 Moving to the left 3 position , 1000 = 8
System.out.println(1 << 4); // 1 Moving to the left 4 position ,10000 = 16
System.out.println(2 << 1); // 2 Moving to the left 1 position ,10 change 100 namely 4
System.out.println(2 << 2); // 2 Moving to the left 2 position ,10 change 1000 namely 8
System.out.println(2 << 3); // 2 Moving to the left 3 position ,10 change 10000 namely 16
System.out.println(2 << 4); // 2 Moving to the left 4 position ,10 change 100000 namely 32
System.out.println(3 << 1); // 3 Moving to the left 1 position ,11 change 110 namely 6
System.out.println(3 << 2); // 3 Moving to the left 2 position ,11 change 1100 namely 12
System.out.println(3 << 3); // 3 Moving to the left 3 position ,11 change 11000 namely 24
System.out.println(3 << 4); // 3 Moving to the left 4 position ,11 change 110000 namely 48
/*** Move right test ***/
// Operands Shift right arrow Shift the number of digits to the right Binary system Decimal system
System.out.println(1 >> 0); // 1 Move right 0 position , 1 = 1
System.out.println(1 >> 1); // 1 Move right 1 position , 0 = 0
System.out.println(1 >> 2); // 1 Move right 2 position , 0 = 0
System.out.println(1 >> 3); // 1 Move right 3 position , 0 = 0
System.out.println(1 >> 4); // 1 Move right 4 position , 0 = 0
System.out.println(2 >> 0); // 2 Move right 1 position ,10 change 10 namely 2
System.out.println(2 >> 1); // 2 Move right 1 position ,10 change 01 namely 1
System.out.println(2 >> 2); // 2 Move right 2 position ,10 change 00 namely 0
System.out.println(2 >> 3); // 2 Move right 3 position ,10 change 00 namely 0
System.out.println(2 >> 4); // 2 Move right 4 position ,10 change 00 namely 0
System.out.println(3 >> 1); // 3 Move right 1 position ,11 change 01 namely 1
System.out.println(3 >> 2); // 3 Move right 2 position ,11 change 00 namely 0
System.out.println(3 >> 3); // 3 Move right 3 position ,11 change 00 namely 0
System.out.println(3 >> 4); // 3 Move right 4 position ,11 change 00 namely 0
}
}
边栏推荐
- A little understanding of GSLB (global server load balance) technology
- [openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
- QT QTableWidget 表格列置顶需求的思路和代码
- Impact relay jc-7/11/dc110v
- Json Web token - jwt vs. Traditional session login Authentication
- Learning multi-level structural information for small organ segmentation
- Uninstall Google drive hard drive - you must exit the program to uninstall
- Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
- Detailed explanation of common APIs for component and container containers: frame, panel, scrollpane
- JS get the attribute values nested in the object
猜你喜欢

How does apscheduler set tasks not to be concurrent (that is, execute the next task after the first one)?

JSON Web Token----JWT和傳統session登錄認證對比

C language - Blue Bridge Cup - Snake filling
![[untitled]](/img/32/cfd45bb5e8555ea2ad344161370dbe.png)
[untitled]

Steady! Huawei micro certification Huawei cloud computing service practice is stable!

How to expand all collapse panels

A little understanding of GSLB (global server load balance) technology

QT 获取随机颜色值设置label背景色 代码

js arguments参数使用和详解

InputStream/OutputStream(文件的输入输出)
随机推荐
gslb(global server load balance)技术的一点理解
SQL injection SQL lab 11~22
【无标题】
Recommended system 1 --- framework
Practical gadget instructions
Kubernets first meeting
Arcpy 利用updatelayer函数改变图层的符号系统
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
webrtc 快速搭建 视频通话 视频会议
win10清除快速访问-不留下痕迹
A little understanding of GSLB (global server load balance) technology
Distributed cap theory
QT qtablewidget table column top requirements ideas and codes
2022.7.2-----leetcode.871
Learning multi-level structural information for small organ segmentation
el-select如何实现懒加载(带搜索功能)
Compound nonlinear feedback control (2)
MySQL information_ Schema database
Functions in C language (detailed explanation)
Json Web token - jwt vs. Traditional session login Authentication