code: static long power(long base, short exponent) {
          if (exponent < 0) {
              throw new IllegalArgumentException("Exponent can not be negative");
          }
          if (base < 0) {
              throw new IllegalArgumentException("Base can not be negative");
          }
          long result = 1;
          while (exponent > 0) {
              if ((exponent & 1) == 1) {
                  result *= base;
              }
              base *= base;
              exponent >>= 1;
          }
          return result;
      }
docs: This is an equivalent to Math.pow that accurately works on 64-bit numbers
  @param base The base
  @param exponent The exponent
  @return radix ** exponent
  @see Math#pow(double, double)