package org.matheclipse.core.reflection.system;
import org.matheclipse.core.eval.exception.Validate;
import org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.interfaces.IAST;
import org.matheclipse.core.interfaces.IExpr;
import org.matheclipse.core.interfaces.ISymbol;
/**
* Predicate function
*
* Returns True if the first argument is an integer;
* False otherwise
*/
public class IntegerQ extends AbstractFunctionEvaluator {
public IntegerQ() {
}
@Override
public IExpr evaluate(final IAST ast) {
Validate.checkSize(ast, 2);
return F.bool(ast.arg1().isInteger());
}
@Override
public void setUp(final ISymbol symbol) {
symbol.setAttributes(ISymbol.LISTABLE);
}
}
Ads help maintain this website.