LemonBoy 538d485782 std: Add pow(a,b) for big ints
Implemented following Knuth's "Evaluation of Powers" chapter in TAOCP,
some extra complexity is needed to make sure there's no aliasing and
avoid allocating too many limbs.

A brief example to illustrate why the last point is important:
consider 10^123, since 10 is well within the limits of a single limb we
can safely say that the result will surely fit in:

⌈log2(10)⌉ bit * 123 = 492 bits = 7 limbs

A naive calculation using only the number of limbs yields:

1 limb * 123 = 123 limbs

The space savings are noticeable.
2020-10-04 02:24:40 -04:00
..
2020-10-04 02:24:40 -04:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-20 16:07:04 -04:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00
2020-08-26 10:50:34 +02:00