public void TestFactorial() { int n = 0; double s = 0; n = 0; s = MathX.Factorial(n); AssertEquals("Factorial ", 1, s); n = 1; s = MathX.Factorial(n); AssertEquals("Factorial ", 1, s); n = 10; s = MathX.Factorial(n); AssertEquals("Factorial ", 3628800, s); n = 99; s = MathX.Factorial(n); AssertEquals("Factorial ", 9.33262154439E+155, s); n = -1; s = MathX.Factorial(n); AssertEquals("Factorial ", Double.NaN, s); n = Int32.MaxValue; s = MathX.Factorial(n); AssertEquals("Factorial ", Double.PositiveInfinity, s); }
public override double Evaluate(double d) { return(MathX.Factorial((int)d)); }