开发者

Logical (AND, OR, XOR) over Long

I am extending a tool in Java 开发者_高级运维that somehow is capable of applying Logical (AND, OR and XOR) over three Long values.

How is that possible? If it is possible?


You can apply bit-wise operators on longs:

  • & is AND
  • | is OR
  • ^ is XOR


Maybe they wanted to implement IDL-like logical operators

Default Definitions of True and False

Data Type                    True                              False 
====================================================================================
Byte,integer, and long       Odd integers                      Zero or even integers 
Floating point and complex   Non-zero values                   Zero 
String                       Any string with non-zero length   Null string (" ") 
Heap variables               Non-null values                   Null values


What do you mean by not possible? 3 | 4 | 5 is a perfectly valid expression as 3 & 4 & 5.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜