LargeInteger doesn't appear to have an equivalent function to BigInteger's and.
Since and(BigInteger val) "Returns a BigInteger whose value is (this & val). (This method returns a negative BigInteger if and only if this and val are both negative.)", I tried to follow this great answer on reproducing testBit with
static LargeInteger and(LargeInteger i, LargeInteger j) {
return i & j;
}
but the compiler reports
error: bad operand types for binary operator '&'
return i & j;
^
How can BigInteger's and be reproduced to be used on LargeInteger?
org.jscience.mathematics.number.LargeIntegerdoes not seem to have a similar bit-wise functionand(if I have sougth the right class & version).Mind, that for a bitwise
orthe condition needs||instead of&&.