|
SOLUTIONS
|
-
Functions
- AlgebraicIntegerQ
- And
- ArrayQ
- AtomQ
- CoprimeQ
- DigitQ
- Equal
- EvenQ
- False
- Greater
- GreaterEqual
- IntegerQ
- Less
- LessEqual
- LetterQ
- MachineNumberQ
- MatchQ
- MatrixQ
- MemberQ
- Negative
- NonNegative
- NonPositive
- Not
- NumberQ
- NumericQ
- OddQ
- Or
- OrderedQ
- PolynomialQ
- Positive
- PossibleZeroQ
- PrimeQ
- SameQ
- StringFreeQ
- StringMatchQ
- StringQ
- SyntaxQ
- True
- TrueQ
- Unequal
- UnsameQ
- VectorQ
- Related Guides
- Tutorials
Testing Expressions
Mathematica symbolic expressions can represent an immense range of types of objects. Mathematica provides a rich collection of functions to test expressions. Functions that "ask a question" have names that end in Q. They return True for an explicit true answer, and False otherwise.
ReferenceReference
Equality & Inequality
Equal (==), Unequal (!=) — numerical equality
SameQ (===), UnsameQ (=!=) — literal symbolic identity
Less(<) ▪ Greater(>) ▪ LessEqual(<=) ▪ GreaterEqual(>=)
Logical Combinations »
And(&&) ▪ Or(||) ▪ Not(!) ▪ True ▪ False ▪ ...
Numerical Properties »
NumberQ, MachineNumberQ — literal number, literal machine-precision number
NumericQ — numeric quantity (consisting of numbers, numeric constants, and functions)
IntegerQ ▪ EvenQ ▪ OddQ ▪ PrimeQ ▪ CoprimeQ ▪ AlgebraicIntegerQ ▪ ...
Positive ▪ Negative ▪ NonPositive ▪ NonNegative ▪ PossibleZeroQ
List-Oriented Tests
VectorQ, MatrixQ — vector, matrix, perhaps with elements of specified types
ArrayQ — full array of any depth
MemberQ — test whether a pattern occurs in a list
Expression Tests
MatchQ — test whether an expression matches a pattern
AtomQ ▪ TrueQ ▪ OrderedQ ▪ PolynomialQ
String Tests »
StringQ ▪ StringMatchQ ▪ StringFreeQ ▪ LetterQ ▪ DigitQ ▪ SyntaxQ ▪ ...
