EasyManuals Logo
Home>Texas Instruments>Calculator>TI-92+

Texas Instruments TI-92+ User Manual

Texas Instruments TI-92+
507 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 #103 background imageLoading...
Page #103 background image
[3.22] Create lists with logarithmic element spacing
Lists with logarithmic element spacing are useful for creating function plots with logarithmic x-axis
scaling, and for making tables of functions which change rapidly for small values of the indpendent
variable, but less rapidly for larger values. This program creates such a list.
loglist(l,h,n)
Func
©(xl,xh,n) make list of n+1 elements from xl to xh with log-spacing
©19apr00/dburkett@infinet.com
local l1,d
log(l)l1
(log(h)-l1)/nd
seq(10^(l1+k*d),k,0,n)
EndFunc
loglist() creates a list of n+1 elements which range from l to h. For example, if l = 20, h = 20,000 and n
= 10, then the returned list is
{20, 39.91, 79.62, 158.87, 316.99, 632.46, 1261.9, 2517.9, 5023.8, 10023.7, 20000}
Note that the difference between the first two elements is about 20, and the difference between the last
two elements is about 10,000. This is the desired effect of logarithmic spacing.
The function works by logarithmically mapping the original interval [l,h] onto the interval of [log(l),
log(h)].
To make a logarithmic plot of some function f(x), use loglist() to make a list of elements over the
required range of x, and save it as variable list1. Next, use
seq(k,k,0,n)xlist
f(list1)ylist
to make lists of x-coordinate plot values and function values, respectively. Finally, set up a data plot
(not a function plot) in the Y= Editor, using xlist and ylist as the variables to plot.
[3.23] Use single bits as flags to save status information
Sometimes a program needs to save and change the status of several conditions. For example, we
may need to keep track of which operations the user has performed. If each of these operations
requires a lengthy calculation and the user has already performed the operation, we want to skip the
calculation. A typical method to accomplish this record-keeping is to use variables with boolean values
true and false. This is effective if there are only a few status items we need to modify and record, but it
becomes unwieldy if there are many items. If we had 30 status items, we would need to create and
initialize 30 separate variables. Each boolean variable requires three bytes of RAM storage, so our 30
status items would use 90 bytes.
A variable that is used to indicate the status of a condition is called a flag. We can use RAM more
efficiently if we save each status flag as a single bit in an integer. Since we will use the and, or, and xor
operators to manipulate the flags, we can have, at most, 32 flags in a single integer. If you need more
3 - 21

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TI-92+ Specifications

General IconGeneral
BrandTexas Instruments
ModelTI-92+
CategoryCalculator
LanguageEnglish

Related product manuals