Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • C#

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.

using System.Numerics;
var z = BigInteger.Pow(x, n);
import std.bigint;
BigInt z = x ^^ n;

New implementation...