Logo

Programming-Idioms

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

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.

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

New implementation...