bn.js icon indicating copy to clipboard operation
bn.js copied to clipboard

bn: introduce small pow, .pown() [WIP]

Open axic opened this issue 9 years ago • 3 comments
trafficstars

Compared to the benchmarks in #121 it performs as:

bn.js pown#pow x 11,994 ops/sec ±3.01% (9 runs sampled)
bn.js ipown#pow x 11,417 ops/sec ±5.09% (9 runs sampled)

However on bigger powers it is different. Take this PR as a WIP at the moment.

axic avatar Feb 04 '16 11:02 axic

Any update?

alidavut avatar May 16 '21 13:05 alidavut

I think technically works (but would need a rebase and confirming it still works), however perhaps the gain wasn't significant enough at the time?

If there's interest getting this merged, I can rebase it.

axic avatar May 17 '21 10:05 axic

I'm new at bn.js and in my first day I needed a function like this. Current pow function needs a BN instance which is not usable much for standard js numbers, adds extra code. @indutny ?

alidavut avatar May 17 '21 13:05 alidavut