Is there a binary operator in Beanshell for a logical negation ¬ (not) or a workaroung for it? e.g.

 3∧¬5 = 2
有帮助吗?

解决方案

Determine bits exclusive to the two values (not on in both). Then mask off the first value to leave the bits that are exclusive in the second value, thus showing the bits that are not in the first value.

    a = 3;
    b = 5;
    print((a ^ b) & a); // ==>2
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top