Questions about Mathematica's predicate functions.
Questions about Mathematica's predicate functions, usually ending with Q
(indicating "question"). These functions test the input expression whether it fits the condition defined by the predicate function. These functions can test numerical properties (Negative
, Positive
, OddQ
, etc.), equality/identity/relation (Equal
, SameQ
, LessEqual
, etc.), data types (NumericQ
, IntegerQ
, StringQ
, SymbolQ
, etc.), and general expressions (TrueQ
, AtomQ
, etc.).
Useful links
- Testing Expressions guide
- Understand the difference between exact and approximate (Real) numbers
- Difference between 0. and 0
Example question