Closed arjunaskykok closed 5 years ago
If I understand correctly, the problem is that you're using the Javascript &
operator instead of the library's .and()
method.
Doing
a & 1
will coerce a
to native Javascript number (8.22752278660603e+62
) and then perform the operation. If you want to preserve precision, you should use the .and
operator:
> a.and(1).toString()
"1"
The result is:
I caught this bug when I tried to implement Elliptic Curve Cryptography with this library. It's for learning purpose.