Logo

Programming-Idioms

History of Idiom 66 > diff from v325 to v326

Edit summary for version 326 by programming-idioms.org:
[Elixir] +DemoURL. +Warning

Version 325

2016-11-13, 14:34:06

Version 326

2016-11-30, 22:28:07

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
z = :math.pow(x, n)
Code
z = :math.pow(x, n)
Comments bubble
This returns a float, not exactly a big integer.
Demo URL
http://play.elixirbyexample.com/s/0e112751a8