コード例 #1
0
  @Override
  public Operand executeOperation(Stack<Expression> operands) throws ExpressionException {
    if (operands.size() < this.getCurrentOperands())
      throw new ExpressionException("Wrong number of given parameters");

    Apfloat value1 = Operand.extractNumber(operands.pop());

    return new Operand(new Apfloat(value1.intValue()));
  }
コード例 #2
0
  @Override
  public Operand executeOperation(Stack<Expression> operands) throws ExpressionException {
    if (operands.size() < this.getCurrentOperands())
      throw new ExpressionException("Wrong number of given parameters");

    Apfloat value1 = Operand.extractNumber(operands.pop());
    Apfloat radians = this.toRadians(value1);

    return new Operand(ApfloatMath.sinh(radians));
  }