4 ms·
Exponentiation is almost never shippable code, most languages have an operator or standard library for that.
by braythwayt 8y ago
Exponentiation is almost never shippable code, most languages have an operator or standard library for that.
- paulddraper 8y agoFor certain ranges of numbers. But you could imagine this being part of, say, a "big integer" library. (Which C, C++, PHP, JS all lack.)
- braythwayt 8y agoIf you like esoteric, I learned this algorithm for obtaining the exponent of a 2x2 matrix, which amusingly enough is part of an interesting fibonaccialgorithm.
- ZeikJT 8y agoYou will hopefully have to edit out JS someday: https://github.com/tc39/proposal-bigint https://github.com/tc39/proposal-bigint https://developers.google.com/web/updates/2018/05/bigint https://developers.google.com/web/updates/2018/05/bigint