标签:src ISE lse ide 算数 click 数字 hide 大于
1.算数运算符 +,-,*,/,%,**,// (1)加号(Plus) + (2)减号(Minus)- (3)乘号(Multipy) * (4)乘方(Power)** 例如:3 ** 4 = 3 * 3 * 3* 3 (5)除号1(Divide) / (6)除号2(Fllor) // a // b:结果与a,b的小数位有关 (7) 模(Modulo)% 2.位操作运算符 (1)左移位(Left Shift)<< 2 << 2 -->00000010向左移动2位:00001000 = 8(等效于右边加2个0,左边去2个0) (2)右移位(Right Shift)>> 与左移位相反 (3)按位与(Bitwise AND)& 5 & 3 = 00000101 & 00000011 = 00000001(都是1才为1,否则为0) (4)按位或(Bitwise OR)| 5 | 3 = 00000101 | 00000011 = 00000111(有1为1,都是0才为0) (5)按位异或(Bit-wise XOR) ^ 5 ^ 3 = 00000101 ^ 00000011 = 0000110(都是1或都是0返回0,否则返回1) (6)按位取反(Bit-wise invert) ~ ~ x = - (x+1) 例如:~00000101 = - 00000110 = 10000110 3.比较运算符 >, <, >=, <=, !=, ==,返回值是True,False (1)小于(Less Than)< (2)小于等于(Less Than or Equal To)<= (3)大于(Greater Than)> (4)大于等于(Greater Than or Equal To)>= (5)判断是否等于(Equal To)== (6)不等于(Not Equal To)!=
标签:src ISE lse ide 算数 click 数字 hide 大于
原文地址:https://www.cnblogs.com/bashliuhe/p/12547589.html