BigInteger icon indicating copy to clipboard operation
BigInteger copied to clipboard

bitwise operations missing

Open cyan-2048 opened this issue 1 year ago • 3 comments

I was testing out this library as I have seen in benchmarks that this library is very good.

this library is also a very nice replacement for JSBI, I was crying in my bed when errors occured when bitwise methods were missing

Operation native BigInts JSBI
Bitwise negation b = ~a b = JSBI.bitwiseNot(a)
Bitwise “and” c = a & b c = JSBI.bitwiseAnd(a, b)
Bitwise “or” c = a | b c = JSBI.bitwiseOr(a, b)
Bitwise “xor” c = a ^ b c = JSBI.bitwiseXor(a, b)

cyan-2048 avatar Feb 14 '25 13:02 cyan-2048

left shifting and right shifting operations should be in the code, unless missed in npm package also, there are BigInt.asUintN and BigInt.asIntN

Yaffle avatar Feb 14 '25 20:02 Yaffle

left shifting and right shifting operations should be in the code, unless missed in npm package also, there are BigInt.asUintN and BigInt.asIntN

mb, I edited the issue, I saw the errors in console and assumed all bitwise operations are missing

cyan-2048 avatar Feb 15 '25 08:02 cyan-2048

btw, this project is not in active development, and I have no much interest in working on it. Native BigInt is much faster and has good browser support

Yaffle avatar Feb 15 '25 11:02 Yaffle