Help for this page

Select Code to Download


  1. or download this
    sub next_pwr {
      my ($x,$p) = (@_,2);  # default to next_pwr(X,2)
    ...
      $log = int($log+1) if $log != int($log);
      return $p**$log;
    }
    
  2. or download this
    {
      my %LOG = (2 => log(2));  # most common
    ...
        return $p ** $log;
      }
    }