IntegerQ¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
IntegerQ[expr]
gives True if expr is an Integer or BigInt, False otherwise.
Notes
Returns False on rationals with denominator \> 1, reals, and symbolic expressions (even those that are integer-valued, e.g. 2 Pi / Pi).Examples (10)¶
Every input below was run against the current Mathilda build and its output recorded.
Basic examples (4)¶
In[1]:= StringQ["AbC"]
Out[1]= True
In[2]:= StringQ[""]
Out[2]= True
In[3]:= StringQ[123]
Out[3]= False
In[4]:= StringQ[] StringQ::argx: StringQ called with 0 arguments; 1 argument is expected.
Scope (6)¶
Overflows to +inf
MPFR, not machine
Exact Gaussian integer
Implementation notes¶
builtin_integerq (src/core.c) returns True exactly when expr_is_integer_like(arg) holds (an EXPR_INTEGER or EXPR_BIGINT), and False otherwise.
Attributes: Protected.
References¶
See also: AtomQ, NumberQ, StringQ, MachineNumberQ, Complex, ExactNumberQ
- Source:
src/core.c - Specification:
docs/spec/builtins/expression-information.md - Tests:
tests/test_bigint.c - Tests:
tests/test_core.c - Tests:
tests/test_divisible.c - Tests:
tests/test_meminfo.c