Open barakman opened 2 years ago
Currently, the only type of exponentiation supported, is for raising a BN object to the power of a a BN object.
BN
Every other binary operation supports the 2nd operand being both a BN object and a plain JavaScript Number:
bn1.add(bn2)
bn.addn(num)
bn1.sub(bn2)
bn.subn(num)
bn1.mul(bn2)
bn.muln(num)
bn1.div(bn2)
bn.divn(num)
bn1.mod(bn2)
bn.modn(num)
So it seems a bit odd that function pow is provided, but function pown is not provided.
pow
pown
Currently, the only type of exponentiation supported, is for raising a
BN
object to the power of a aBN
object.Every other binary operation supports the 2nd operand being both a
BN
object and a plain JavaScript Number:bn1.add(bn2)
andbn.addn(num)
bn1.sub(bn2)
andbn.subn(num)
bn1.mul(bn2)
andbn.muln(num)
bn1.div(bn2)
andbn.divn(num)
bn1.mod(bn2)
andbn.modn(num)
So it seems a bit odd that function
pow
is provided, but functionpown
is not provided.