fork(5) download
  1. sub integer_root ( Int $p where * >= 2, Int $n --> Int ) {
  2. my Int $d = $p - 1;
  3.  
  4. my $guess = '1' ~ ( '0' x ($n.chars / $p) );
  5.  
  6. my $iterator = { ( $d * $^x + $n div ($^x ** $d) ) div $p };
  7.  
  8. my $endpoint = { $^x == $^y|$^z };
  9.  
  10. return [min] (+$guess, $iterator … $endpoint)[*-1, *-2];
  11. }
  12.  
  13. say integer_root( 2, 2 * 100 ** 2000 );
Runtime error #stdin #stdout #stderr 1.61s 194240KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
===SORRY!=== Error while compiling prog.pl
Two terms in a row
at prog.pl:10
------>     return [min] (+$guess, $iterator ⏏… $endpoint)[*-1, *-2];
    expecting any of:
        postfix
        infix stopper
        infix or meta-infix
        statement end
        statement modifier
        statement modifier loop