PDL doesn't support integer exponentiation (it uses the pow() function and generic type D).
This causes problems for calculations like this:
$bignum = longlong(2)**55;
$bignum is type double and the value is rounded. It would be helpful if PDL supported
binary exponentiation for integer data types and/or exponent values. At the moment,
an ipow() implementation using repeated squares and multiplies would be nice to
have even without seamless handling of the various edge cases to do what I mean.
Ideally this would be added to the longlong-double-fix branch before merging into master
for a CPAN release.
NOTE: that without arbitrary precision integer support, the range of exponents to calculate is very limited with the greatest being for powers of 2 where the largest exponent is 64. Hence this is the largest exact value needed to calculate by ipow(), ~7bits binary. If one takes advantage of the range of values for which the double precision result of pow() is exact, then the ipow() calculation would only be needed for less than 12 or so integer values.
Attached is a perl implementation from Wikipedia that only works for scalar values at the moment. Needs to be modified to support pdl arguments.
A basic ipow() PDL::PP implementation is in git master and will appear in the next CPAN release.