Example #1
0
 public static Expression Factorial(Constant x)
 {
     if (x.IsInteger())
     {
         return(new Real(Factorial((BigInteger)(Real)x)));
     }
     else
     {
         throw new ArgumentException("Factorial cannot be called for non-integer value.");
     }
 }
Example #2
0
 public static Expression IsNatural(Constant x)
 {
     return(Constant.New(x.IsInteger() && (Real)x > 0));
 }
Example #3
0
 public static Expression IsInteger(Constant x)
 {
     return(Constant.New(x.IsInteger()));
 }