:

How to take a number to a UInt exponent?

Added by: ~TheGhostOf, 2012 II 27

Added by: ~TheGhostOf, 2012 II 27

I would like to take two to a UInt exponent. How would I do that?

Added by: tomek, 2012 III 13, Last modified: 2012 III 13

ttmath::UInt<3> a, b;

a = 2;
b = 10;
a.Pow(b);

std::cout << a << std::endl;

or if b is sufficient small:
a = 2;
a.Rcl(b.ToUInt() - 1);
std::cout << a << std::endl;