Appendix A: System Routines — EStack Arithmetic
491
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_is_prime
Declaration:
void
push_is_prime
(EStackIndex
i
)
Category(ies):
EStack Arithmetic
Description:
Pushes TRUE if the expression indexed by
i
is determined to be a prime
exact whole number, such as 2, 2., 3, 3., 5, 5., etc. Pushes FALSE if it is
any other number or a transfinite tag. Otherwise throws ER_DOMAIN.
NOTE:
Floats > MAX_EXACT_FLOAT_WHOLE_NUMBER are whole numbers, but not
exact whole numbers.
Inputs:
i
— Index to the top tag of an expression.
Outputs:
None
Assumptions:
None
Side Effects:
None
Availability:
On AMS 2.02 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: push_factor
Example:
push_Float (2.0);
push_is_prime (top_estack); /* Pushes TRUE_TAG */
push_is_prime (Integer1Index); /* Pushes FALSE_TAG */
push_negate_quantum_as_negint (2u);
push_is_prime (top_estack); /* Pushes FALSE_TAG */
push_reciprocal_of_quantum (2u);
push_is_prime (top_estack); /* Pushes FALSE_TAG */