lead_term_index Function (ROM Call 0x2E1)

AMS 1.01 or higher estack.h

ESI lead_term_index (CESI ptr);

Gets the index of the lead term of an expression.

If ptr points to the ADD_TAG, which is a case when it points to an expression of form term1 + term2 + ... (i.e. if the expression is a sum of simpler terms), lead_term_index returns the pointer to term1 (i.e. to the lead term). If ptr does not point to the ADD_TAG (i.e. if the expression is not a sum of simpler terms), lead_term_index returns ptr (i.e. the pointer to the expression itself).

Note: Expressions in internal canonic form have the most main term shallowest, with less main terms deeper (see compare_expressions about more info about "main" ordering). Also, the lead term of an internally-simplified sum is never a sum. For example, the lead term of '(2+x)+y' converted to canonic form is 'x'. By default, similar powers of the main variable are collected in internal canonic forms. For example, the lead term of 'x^2*y+x^2+5' converted to canonic form is 'x^2*(y+1)'. See push_internal_simplify for more info about how to convert an expression into the internal canonic form.


Used by: index_of_lead_base_of_lead_term, did_push_anti_deriv, did_push_series, push_1st_derivative, push_abs, push_acosh, push_asin, push_asinh, push_atan, push_atanh, push_comdenom, push_csolve, push_czeros, push_def_int, push_desolve, push_expand, push_extended_prod, push_factor, push_floor, push_lim, push_max, push_min, push_nsolve, push_phase, push_sign, push_sin2, push_solve, push_summation, push_zeros, did_push_to_polar, push_equals, push_exponentiate, push_greater_than, push_greater_than_or_equals, push_less_than, push_less_than_or_equals, push_negate, push_not_equals, push_product, push_sum, push_to_cylin, push_to_sphere, add_to_top, get_ub, index_if_pushed_binomial_info, index_reductum_with_tag_base, push_but_term, push_constant_terms, push_dependent_terms, push_gcd_then_cofactors, push_independent_terms, push_make_proper, push_nonconstant_terms, push_poly_qr, push_reciprocal, push_standardize, replace_top_with_post_simplified, replace_top2_with_sum