code: public static double log(double d, double base) {
          if(base==1.0 || base<=0.0) {
              throw new IllegalArgumentException("Invalid base for logarithm.");
          }
          return Math.log(d)/Math.log(base);
      }
docs: Returns the logarithm of a number at an arbitrary base.
  
  @param d
  @param base
  @return