Does LargeInteger
have an equivalent to BigInteger
's testBit
?
If not, how can testBit
be performed on a LargeInteger
?
I don't yet have the necessary skills to reproduce ((this & (1<<n)) != 0)
.
I tried making a method by just copying & pasting the above code referenced from the docs:
static boolean testBit(int n){
return ((this & (1<<n)) != 0);
}
However, the compiler reports:
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);
^