462
Appendix A: System Routines — EStack Arithmetic
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
add1_to_top
Declaration:
void
add1_to_top
(void)
Category(ies):
EStack Arithmetic
Description:
Replaces the expression on the top of the estack with the
internally-simplified sum of the top plus one. If IS_ARITH_APPROX is true,
a floating-point one (1.0) is added. Otherwise, a tagged integer one (1) is
added. If the top of the estack is a square matrix, the one is added only to
the diagonal of the matrix.
Inputs:
None
Outputs:
None
Assumptions:
The top of the estack is an internally-simplified algebraic expression,
algebraic comparison, or aggregate thereof.
Side Effects:
May cause heap compression or throw an error.
Availability:
On AMS 2.02 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: push_sum, replace_top2_with_sum, push_difference,
subtract_from_top, replace_top2_with_difference, add_to_top,
subtract1_from_top, push_arg_plus_1, push_arg_minus_1
Example:
void push_unit_step (EStackIndex i)
/* Pushes (sign(i) + 1)/2 onto the estack. */
{ Access_AMS_Global_Variables;
push_sign (i);
add1_to_top ();
i = top_estack;
push_reciprocal_of_quantum (2u);
replace_top2_with_prod (i);
}