示例#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.");
     }
 }
示例#2
0
 public static Expression IsNatural(Constant x)
 {
     return(Constant.New(x.IsInteger() && (Real)x > 0));
 }
示例#3
0
 public static Expression IsInteger(Constant x)
 {
     return(Constant.New(x.IsInteger()));
 }