Example #1
0
  public Object acosh(Object param) throws ParseException {
    if (param instanceof Complex) {
      return ((Complex) param).acosh();
    } else if (param instanceof Number) {
      double val = ((Number) param).doubleValue();
      if (val >= 1.0) {
        double res = Math.log(val + Math.sqrt(val * val - 1));
        return new Double(res);
      } else {
        Complex temp = new Complex(((Number) param).doubleValue(), 0.0);
        return temp.acosh();
      }
    }

    throw new ParseException("Invalid parameter type");
  }