コード例 #1
0
 public void AddBinaryOperation(IBinaryOperation operation)
 {
     if (!BinaryOperations.Contains(operation))
     {
         BinaryOperations.Add(operation);
     }
 }
コード例 #2
0
        private static void RegiterOperations()
        {
            BinaryOperations.Add(OperatorTypes.Add, Add);
            BinaryOperations.Add(OperatorTypes.Subtract, Subtract);
            BinaryOperations.Add(OperatorTypes.Divide, Divide);
            BinaryOperations.Add(OperatorTypes.Multiply, Multiply);
            BinaryOperations.Add(OperatorTypes.Power, Pow);

            UnaryOperations.Add(OperatorTypes.Sign, Sign);
        }