Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for raising a BN object to the power of a plain JavaScript Number #287

Open
barakman opened this issue Jan 11, 2022 · 0 comments

Comments

@barakman
Copy link

Currently, the only type of exponentiation supported, is for raising a BN object to the power of a a BN object.

Every other binary operation supports the 2nd operand being both a BN object and a plain JavaScript Number:

  • bn1.add(bn2) and bn.addn(num)
  • bn1.sub(bn2) and bn.subn(num)
  • bn1.mul(bn2) and bn.muln(num)
  • bn1.div(bn2) and bn.divn(num)
  • bn1.mod(bn2) and bn.modn(num)

So it seems a bit odd that function pow is provided, but function pown is not provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant