public void Factorial()
        {
            var expr = MathS.Factorial(x + 3) / MathS.Factorial(x + 1);

            Assert.Equal(MathS.Pow(x, 2) + x * 3 + (2 * x + 6), expr.Expand());
            expr = MathS.Factorial(x + -3) / MathS.Factorial(x + -1);
            Assert.Equal(1 / (x + -2) / (x + -1), expr.Expand());
        }
Пример #2
0
 [Fact] public void TestFormula27() => Assert.Equal(MathS.Factorial("-1"), FromString("(-1)!"));
Пример #3
0
 [Fact] public void TestFormula26() => Assert.Equal(-MathS.Factorial(1), FromString("-1!"));
Пример #4
0
 [Fact] public void TestFormula25() => Assert.Equal(Pow(MathS.Factorial(2), Factorial(x + 2)), FromString("2!^(x+2)!"));
Пример #5
0
 [Fact] public void TestFormula24() => Assert.Equal(Pow(MathS.Factorial(2), MathS.Factorial(3)), FromString("2!^3!"));
Пример #6
0
 [Fact] public void TestFormula23() => Assert.Equal(Pow(2, MathS.Factorial(3)), FromString("2^3!"));
Пример #7
0
 [Fact(Skip = "Why StackOverflow here?")] public void TestFormula27() => Assert.Equal(MathS.Factorial(-1), FromString("(-1)!"));
Пример #8
0
 // x!! is the double factorial, (x!)! is factorial appplied twice which is different
 [Fact] public void FactorialFactorialX() => Test(@"\left(x!\right)!", MathS.Factorial(MathS.Factorial(x)));
Пример #9
0
 [Fact] public void FactorialSinX() => Test(@"\sin\left(x\right)!", MathS.Factorial(MathS.Sin(x)));
Пример #10
0
 [Fact] public void FactorialX() => Test(@"x!", MathS.Factorial(x));
Пример #11
0
 [Fact] public void Factorial1PI() => Test(@"\left(1 + i\right)!", MathS.Factorial(1 + MathS.i));
Пример #12
0
 [Fact] public void Factorial1MI() => Test(@"\left(1 - i\right)!", MathS.Factorial(1 - MathS.i));
Пример #13
0
 [Fact] public void FactorialI() => Test(@"i!", MathS.Factorial(MathS.i));
Пример #14
0
 [Fact] public void FactorialM23() => Test(@"\left(-23\right)!", MathS.Factorial(-23));
Пример #15
0
 [Fact] public void Factorial23() => Test(@"23!", MathS.Factorial(23));
Пример #16
0
 [Fact] public void Factorial1() => Test(@"1!", MathS.Factorial(1));