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