Ejemplo n.º 1
0
            public override double Call(List <double> in_parameters)
            {
                if (in_parameters.Count != ParameterCount)
                {
                    throw new Exception("Combination must have 2 parameter");
                }

                // Check for int
                if (Math.Truncate(in_parameters[0]) != in_parameters[0] &&
                    Math.Truncate(in_parameters[1]) != in_parameters[1])
                {
                    throw new Exception("Combination only accept integer paramaters");
                }

                return(Factorial.Do(in_parameters[0]) /
                       (Factorial.Do(in_parameters[1]) * Factorial.Do(in_parameters[0] - in_parameters[1])));
            }