$power=Math::BigInt->new($initial_index); $distance_index=($power->bpow($distance))->numify(); #### cmpthese -3, { BigInt => q[ my $x = Math::BigInt->new( $_ )->bpow( 4 )->numify() for 2 .. 1e6; ], standard => q[ my $x = $_ ** 4 for 2 .. 1e6; ], };; (warning: too few iterations for a reliable count) s/iter BigInt standard BigInt 172 -- -100% standard 0.625 27472% --