EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Developer's Guide

Texas Instruments TI-89
1398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #217 background imageLoading...
Page #217 background image
Chapter 15: Expressions and The Expression Stack
175
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
top expression with its reciprocal; and
replace_top_with_post_simplified
replaces the top expression (assumed to be internal form) with its external
tokenized form.
Routines whose names begin with “is_” are used to get information about
expressions. They have no effect on the contents of the estack or the
expressions they inspect. However, sometimes they must perform some
temporary computation to determine the requested information. Under these
circumstances the estack may temporarily grow. For example,
is_negative
tests
whether an expression is negative;
is_real
tests whether an expression is real;
and,
is_equivalent_to
tests whether one expression is equivalent to another.
Routines whose names begin with “index_” or end with “_index” are used to
locate expressions or subexpressions. They also have no effect on the estack or
expressions. They simply return the EStackIndex of the located expression. For
example,
next_expression_index
returns the index of the next expression
below the expression pointed to by its input argument;
lead_factor_index
returns the index of the first factor of the multiplication pointed to by its input
argument; and,
remaining_factors_index
returns the index of the remaining
factors following the first factor of the multiplication pointed to by its input
argument.
See
Appendix A: System Routines
for a complete list of the system routines
that perform estack operations.
15.6. An Example of Working on the EStack
This section takes a simple C language programming example and works
through alternative implementations to show how the same operations can be
done using estack operations. We begin with a C language implementation of a
function to compute the future value of a lump sum present value given the periodic
interest rate and the number of periods. The formula for this computation is
future_value = present_value * ( interest_rate + 1) ^ number_of_periods.
C programming language example:
/* This function takes three BCD16 arguments.
pv = present value
ir = interest rate
np = number of periods
The function returns future value fv as a BCD16.
*/
BCD16 fv (BCD16 pv, BCD16 ir, BCD16 np)
{ return pv * pow(ir + 1.0, np);
}

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals