code: private int integerDigits(double d) {
      double value = Math.abs(d);
      if(value < 10) {
        return 1;
      }
      return (int) FastMath.log10(value) + 1;
    }
docs: Returns the integer digits of the specified double value.
  
  @param d the double value
  @return the integer digits of the specified double value