Logo

Programming-Idioms

History of Idiom 66 > diff from v326 to v327

Edit summary for version 327 by 1.7.4:
New JS implementation by user [1.7.4]

Version 326

2016-11-30, 22:28:07

Version 327

2019-01-24, 12:05:30

Idiom #66 Big integer exponentiation

Calculate the result z of x power n, where x is a big integer and n is a positive integer.

Idiom #66 Big integer exponentiation

Calculate the result z of x power n, where x is a big integer and n is a positive integer.

Code
let z = x**n
Comments bubble
x and n should be of type BigInt, which is only supported in NodeJS, Firefox, and Chrome