indutny / bn.js

BigNum in pure javascript
MIT License
1.19k stars 150 forks source link

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

Open barakman opened 2 years ago

barakman commented 2 years ago

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:

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