LargeInteger
有等价于BigInteger
'stestBit
吗?
如果没有,如何testBit
在 a 上执行LargeInteger
?
我还没有繁殖所需的技能((this & (1<<n)) != 0)
。
我尝试通过复制和粘贴从文档中引用的上述代码来制作一种方法:
static boolean testBit(int n){
return ((this & (1<<n)) != 0);
}
但是,编译器报告:
error: non-static variable this cannot be referenced from a static context
return ((this & (1<<n)) != 0);
^
error: bad operand types for binary operator '&'
return ((this & (1<<n)) != 0);
^