public IOperand OR(IOperand rhs) { if (!(rhs is BoolOperand)) { throw new RPN_Exception("Argument invalid in BoolOperand.|| : rhs"); } BoolOperand oprResult = new BoolOperand("Result"); oprResult.Value = ((bool)this.Value || (bool)((Operand)rhs).Value) ? true : false; return(oprResult); }
public IOperand GreaterThanOrEqualTo(IOperand rhs) { if (!(rhs is DoubleOperand)) { throw new RPN_Exception("Argument invalid in DoubleOperand.>= : rhs"); } BoolOperand oprResult = new BoolOperand("Result"); oprResult.Value = ((Double)this.Value >= (Double)((Operand)rhs).Value) ? true : false; return(oprResult); }
public IOperand LessThan(IOperand rhs) { if (!(rhs is DoubleOperand)) { throw new RPN_Exception("Argument invalid in DoubleOperand.< : rhs"); } BoolOperand oprResult = new BoolOperand("Result"); oprResult.Value = ((Double)this.Value < (Double)((Operand)rhs).Value) ? true : false; return(oprResult); }
/// IComparisonOperators methods. Return values are always BooleanOperands type public IOperand EqualTo(IOperand rhs) { if (!(rhs is DoubleOperand)) { throw new RPN_Exception("Argument invalid in DoubleOperand.== : rhs"); } BoolOperand oprResult = new BoolOperand("Result"); oprResult.Value = (Double)this.Value == (Double)((Operand)rhs).Value; return(oprResult); }
public IOperand GreaterThan(IOperand rhs) { if (!(rhs is LongOperand)) { throw new RPN_Exception("Argument invalid in LongOperand.> : rhs"); } BoolOperand oprResult = new BoolOperand("Result"); oprResult.Value = ((long)this.Value > (long)((Operand)rhs).Value) ? true : false; return(oprResult); }
public IOperand LessThanOrEqualTo(IOperand rhs) { if (!(rhs is LongOperand)) { throw new RPN_Exception("Argument invalid in LongOperand.<= : rhs"); } BoolOperand oprResult = new BoolOperand("Result"); oprResult.Value = ((long)this.Value <= (long)((Operand)rhs).Value) ? true : false; return(oprResult); }