开发者

Beanshell XOR throwing error

开发者 https://www.devze.com 2023-02-13 17:09 出处:网络
When I try to use the xor operator: if(a ^ b) 开发者_开发知识库 I get the following error: internal Error: unimplemented binary operator

When I try to use the xor operator:

if(a ^ b)
开发者_开发知识库

I get the following error:

internal Error: unimplemented binary operator

Is there another way to do it in beanshell, or should I just do:

if((a && !b) || (!a && b))


if(a != b) is equivalent to XOR (a ^ b) for booleans.


In Beanshell2 the xor operator is implemented, see http://code.google.com/p/beanshell2

0

精彩评论

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

关注公众号