254
Appendix A: System Routines — Algebra Utilities
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
is_neg_lead_numr_coef_re_part
(continued)
Example:
void push_integer_part (EStackIndex i)
{ Access_AMS_Global_Variables;
EStackIndex j, old_top = top_estack;
if (LIST_TAG == ESTACK (i))
{ map_tail (push_integer_part, i - 1u);
push_quantum (LIST_TAG);
}
else if (is_nonnegative (i)) push_floor (i);
else if (is_nonpositive (i)) push_ceiling (i);
else if (integer_non_unknown (i) > 0) push_expression (i);
else if (is_neg_lead_numr_coef_re_part(i)) /* iPart(-x) -> -iPart(x) */
{ push_negate (i);
i = top_estack;
push_integer_part (i);
delete_between (old_top, i);
negate_top ();
}
else if (IM_RE_TAG == ESTACK (i))
{ push_integer_part (next_expression_index (--i));
j = top_estack;
push_integer_part (i);
replace_top2_with_imre (j);
}
else
{ push_expression (i);
push_quantum (INT_PART_TAG);
}
} /* end push_integer_part */