258
Appendix A: System Routines — Algebra Utilities
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
is_totally_polynomial
Declaration:
Boolean
is_totally_polynomial
(EStackIndex
i
)
Category(ies):
Algebra Utilities
Description:
Determines whether the expression indexed by
i
is polynomial in all of its
variables, generalized to permit non-negative fractional powers of
variables.
Inputs:
i
— Index of the top tag of an internally-simplified algebraic expression.
Outputs:
Returns TRUE if the expression indexed by
i
is polynomial in all of its
variables, generalized to permit non-negative fractional powers of
variables. Otherwise returns FALSE.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: is_polynomial_in_var_or_kern
Example:
Returns TRUE if
i
indexes (x^(1/2) + y)
†
x.
Returns TRUE if
i
indexes
p
+ ln(2).
Returns FALSE if
i
indexes x^-1 + 2.
Returns FALSE if
i
indexes ln(x).
Boolean is_totally_polynomial (EStackIndex i)
{ Quantum q;
for (;;)
{ if (is_variable (i) || is_constant (i)) return TRUE;
if (EXPONENTIATION_TAG == (q = ESTACK (i)))
{ q = ESTACK (next_expression_index (--i));
if (is_variable (i))
return NONNEGATIVE_INTEGER_TAG == q ||
POSITIVE_FRACTION_TAG == q;
if (NONNEGATIVE_INTEGER_TAG != q) return FALSE;
}
else if ((ADD_TAG == q || MULTIPLY_TAG == q) &&
is_totally_polynomial (--i) )
i = next_expression_index (i);
else return FALSE;
}
}