Command Index

# Ops

+, -, ·, /, ^, ^ֿ¹, ²

.+, .-, .·, ./, .^

=, ≠, <, ≤, >, ≥

(insert implies arrow here), (insert iff arrow here)

10^(), E, !, %, √, ‾

d(), (insert integral symbol here), Π(), Σ(), ΣInt(), ΣPrn()

&, #, ', _, |, ©

(insert angle symbol here), º, ', ", g, r

:=, ▶, →

0b, 0h

# A

abs()

amortTbl()

and

angle()

ANOVA

ANOVA2way

Ans

approx()

▶approxFraction()

approxRational()

arccos()

arccosh()

arccot()

arccoth()

arccsc()

arccsch()

arcLen()

arcsec()

arcsech()

arcsin()

arcsinh()

arctan()

arctanh()

augment()

avgRC()

# B

bal()

▶Base2

▶Base10

▶Base16

binomCdf()

binomPdf()

# C

ceiling()

centralDiff()

cFactor()

char()

charPoly()

x²2way()

x²Cdf()

x²GOF

x²Pdf()

ClearAZ

ClrErr

colAugment()

colDim()

colNorm()

comDenom()

completeSquare()

conj()

constructMat()

CopyVar

corrMat()

▶cos

cos()

cosֿ¹()

cosh()

coshֿ¹()

cot()

cotֿ¹()

coth()

cothֿ¹()

count()

countif()

cPolyRoots()

crossP()

csc()

cscֿ¹()

csch()

cschֿ¹()

cSolve()

CubicReg

cumulativeSum()

Cycle

▶Cylind

cZeros()

# D

dbd()

▶DD

▶Decimal

Define

Define LibPriv

Define LibPub

deltaList()

deltaTmpCnv()

DelVar

delVoid()

derivative()

deSolve()

det()

diag()

dim()

Disp

▶DMS

domain()

dominantTerm()

dotP()

# E

e^()

eff()

eigVc()

eigVl()

Else

ElseIf

EndFor

EndFunc

EndIf

EndLoop

EndPrgm

EndTry

EndWhile

euler()

exact()

Exit

▶exp

exp()

exp▶list()

expand()

expr()

ExpReg

# F

factor()

FCdf()

Fill

FiveNumSummary

floor()

fMax()

fMin()

For

format()

fPart()

FPdf()

freqTable▶list()

frequency()

FTest_2Samp

Func

# G

gcd()

geomCdf()

geomPdf()

getDenom()

getLangInfo()

getLockInfo()

getMode()

getNum()

getType()

getVarInfo()

Goto

▶Grad

# I

identity()

If

ifFn()

imag()

impDif()

Indirection

inString()

int()

intDiv()

integral()

interpolate()

invχ²()

invF()

invNorm()

invt()

iPart()

irr()

isPrime()

isVoid()

# L

Lbl

lcm()

left()

libShortcut()

lim() or limit()

LinRegBx

LinRegMx

LinRegtIntervals

LinRegtTest

linSolv()

ΔList()

list▶mat()

▶ln

ln()

LnReg

Local

Lock

log()

▶logbase

Logistic

LogisticD

Loop

LU

# M

mat▶list()

max()

mean()

median()

MedMed

mid()

min()

mirr()

mod()

mRow()

mRowAdd()

MultReg

MultRegIntervals

MultRegTests

# N

nand

nCr()

nDerivative()

newList()

newMat()

nfMax()

nfMin()

nInt()

nom()

nor

norm()

normalLine()

normCdf()

normPdf()

not

nPr()

npv()

nSolve()

# O

# P

P▶Rx()

P▶Ry()

PassErr

piecewise()

poissCdf()

poissPdf()

▶Polar

polyCoeffs()

polyDegree()

polyEval()

polyGcd()

polyQuotient()

polyRemainder()

polyRoots()

PowerReg

Prgm

prodSeq()

Product (PI)

product()

propFrac()

# Q

# R

R▶Pθ()

R▶Pr()

▶Rad

rand()

randBin()

randInt()

randMat()

randNorm()

randPoly()

randSamp()

RandSeed

real()

▶Rect

ref()

remain()

Request

RequestStr

Return

right()

rk23()

root()

rotate()

round()

rowAdd()

rowDim()

rowNorm()

rowSwap()

rref()

# S

sec()

secֿ¹()

sech()

sechֿ¹()

seq()

seqGen()

seqn()

series()

setModel()

shift()

sign()

simult()

▶sin

sin()

sinֿ¹()

sinh()

sinhֿ¹()

SinReg()

solve()

SortA

SortD

▶Sphere

sqrt()

stat.results

stat.values

stDevPop()

stDevSamp()

Stop

Store

string()

subMat()

Sum (Sigma)

sum()

sumIf()

sumSeq()

system()

# T

T (transpose)

tan()

tanֿ¹()

tangentLine()

tanh()

tanhֿ¹()

taylor()

tCdf()

tCollect()

tExpand()

Text

Then

tInterval

tInterval_2Samp

tmpCnv()

ΔtmpCnv()

tPdf()

trace()

Try

tTest

tTest_2Samp

tvmFV()

tvmI()

tvmN()

tvmPmt()

tvmPV()

TwoVar

# U

# V

# W

# X

# Z

zeros()

zInterval

zInterval_1Prop

zInterval_2Prop

zInterval_2Samp

zTest

zTest_1Prop

zTest_2Prop

zTest_2Samp

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/nspire:command-index

Command Index (Black & White)

**This page lists all of the commands for the TI-83/84/SE/+ models. If you have a newer TI-84 Plus C Silver Edition or TI-84 Plus CE with a color display, please visit the Color Command Index.**

To access more information about the command, click on the command to go to the dedicated page for that command. To view the commands divided into sections, go to the Command Overview. To view most of the commands as they would on the calculator itself through the menus, go to the Command Menu Map.

Some commands have a superscript next to them that indicates compatibility:

^{83+}indicates that the command requires a TI-83+, TI-83+SE, TI-84+, TI-84+SE, or TI-84+CSE calculator.^{84+}indicates that the command requires a TI-84+,TI-84+SE, or TI-84+CSE calculator.^{84+2.30}indicates that the command requires a TI-84+, TI-84+SE, or TI-84+CSE calculator with OS 2.30 or higher.^{84+2.53MP}indicates that the command requires a TI-84+, TI-84+SE, or TI-84+CSE calculator with OS 2.53MP or higher.

See Compatibility for a chart of only the commands that require certain calculators or operating systems.

# Ops

# #

- ֿ¹, ², ³
- √(, ³√(
- 1-PropZInt(
- 2-PropZInt(
- 1-PropZTest(
- 2-PropZTest(
- 2-SampFTest
- 2-SampTInt
- 2-SampTTest
- 2-SampZInt(
- 2-SampZTest(
- 1-Var Stats
- 2-Var Stats

# A

- abs(
- and
- angle(
- ANOVA(
- Ans
- Archive
^{83+} - Asm(
^{83+} - AsmComp(
^{83+} - AsmPrgm
^{83+} - augment(
- AUTO Answer
^{84+2.53MP} - AxesOff
- AxesOn
- a+bi

# B

# C

- checkTmr(
^{84+} - χ²cdf(
- χ²pdf(
- χ²-Test(
- χ²GOF-Test(
^{84+2.30} - Circle(
- CLASSIC
^{84+2.53MP} - Clear Entries
- ClockOff
^{84+} - ClockOn
^{84+} - ClrAllLists
- ClrDraw
- ClrHome
- ClrList
- ClrTable
- conj(
- Connected
- CoordOff
- CoordOn
- cos(
- cosֿ¹(
- cosh(
- coshֿ¹(
- CubicReg
- cumSum(

# D

- dayOfWk(
^{84+} - dbd(
- DEC Answer
^{84+2.53MP} - ►Dec
- Degree
- DelVar
- DependAsk
- DependAuto
- det(
- DiagnosticOff
- DiagnosticOn
- dim(
- Disp
- DispGraph
- DispTable
- ►DMS
- Dot
- DrawF
- DrawInv
- DS<(

# E

# F

# G

- GarbageCollect
^{83+} - gcd(
- geometcdf(
- geometpdf(
- Get(
- GetCalc(
- getDate
^{84+} - getDtFmt
^{84+} - getDtStr(
^{84+} - getKey
- getTime
^{84+} - getTmFmt
^{84+} - getTmStr(
^{84+} - Goto
- GraphStyle(
- GridOff
- GridOn
- G-T

# H

# I

*i*- identity(
- If
- imag(
- IndpntAsk
- IndpntAuto
- Input
- inString(
- int(
- ΣInt(
- invNorm(
- invT(
^{84+2.30} - iPart(
- irr(
- IS>(
- IsClockOn
^{84+}

# L

- ∟
- LabelOff
- LabelOn
- Lbl
- lcm(
- length(
- Line(
- LinReg(a+bx)
- LinReg(ax+b)
- LinRegTInt
^{84+2.30} - LinRegTTest
- ΔList(
- List►matr(
- ln(
- LnReg
- log(
- logBASE(
^{84+2.53MP} - Logistic

# M

- Manual-Fit
^{84+2.30} - MATHPRINT
^{84+2.53MP} - Matr►list(
- max(
- mean(
- median(
- Med-Med
- Menu(
- min(
- ModBoxplot

# N

*n*- nCr
- n/d
^{84+2.53MP} - nDeriv(
- ►n/d◄►Un/d
^{84+2.53MP} - ►Nom(
- Normal
- normalcdf(
- normalpdf(
- NormProbPlot
- not(
- nPr
- npv(

# O

# P

- Param
- Pause
- Plot1(
- Plot2(
- Plot3(
- PlotsOff
- PlotsOn
- Pmt_Bgn
- Pmt_End
- poissoncdf(
- poissonpdf(
- Polar
- ►Polar
- PolarGC
- prgm
- ΣPrn(
- prod(
- Prompt
- Pt-Change(
- Pt-Off(
- Pt-On(
- PwrReg
- Pxl-Change(
- Pxl-Off(
- Pxl-On(
- pxl-Test(
- P►Rx(
- P►Ry(

# Q

# R

- Radian
- rand
- randBin(
- randInt(
- randIntNoRep(
^{84+2.53MP} - randM(
- randNorm(
- Rcl
- re^θi
- Real
- real(
- RecallGDB
- RecallPic
- ►Rect
- RectGC
- ref(
- remainder(
^{84+2.53MP} - Repeat
- Return
- round(
- *row(
- row+(
- *row+(
- rowSwap(
- rref(
- R►Pr(
- R►Pθ(

# S

- Scatter
- Sci
- Select(
- Send(
- seq(
- Seq
- Sequential
- setDate(
^{84+} - setDtFmt(
^{84+} - setTime(
^{84+} - setTmFmt(
^{84+} - SetUpEditor
- Shade(
- Shadeχ²(
- ShadeF(
- ShadeNorm(
- Shade_t(
- Simul
- sin(
- sinֿ¹(
- sinh(
- sinhֿ¹(
- SinReg
- solve(
- SortA(
- SortD(
- startTmr
^{84+} - statwizard-off
^{84+2.55MP} - statwizard-on
^{84+2.55MP} - stdDev(
- Stop
- StoreGDB
- StorePic
- String►Equ(
- sub(
- sum(
- summation Σ(
^{84+2.53MP}

# T

- tan(
- tanֿ¹(
- Tangent(
- tanh(
- tanhֿ¹(
- tcdf(
- Text(
- Then
- Time
- timeCnv(
^{84+} - TInterval
- toString(
- tpdf(
- Trace
- T-Test
- tvm_FV
- tvm_I%
- tvm_N
- tvm_Pmt
- tvm_PV

# U

# V

# W

# X

# Z

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/command-index-bw

Command Index (Color)

**This page lists all of the commands for the TI-84 Plus C Silver Edition and the TI-84 Plus CE. If you have an older TI-83/84+ with a monochrome display, please visit the Monochrome Command Index.**

To access more information about the command, click on the command to go to the dedicated page for that command. To view the commands divided into sections, go to the Command Overview. To view most of the commands as they would on the calculator itself through the menus, go to the Command Menu Map.

Some commands have a superscript next to them that indicates compatibility:

^{CSE}indicates that the command requires a TI-84 Plus CSE^{CE}indicates that the command requires a TI-84 Plus CE or a specific OS version

See Compatibility for a chart of only the commands that require certain calculators or operating systems.

# Ops

# #

- ֿ¹, ², ³
- √(, ³√(
- 1-PropZInt(
- 2-PropZInt(
- 1-PropZTest(
- 2-PropZTest(
- 2-SampFTest
- 2-SampTInt
- 2-SampTTest
- 2-SampZInt(
- 2-SampZTest(
- 1-Var Stats
- 2-Var Stats

# A

- abs(
- and
- angle(
- ANOVA(
- Ans
- Archive
- Asm(
- AsmComp(
- Asm84CPrgm
^{CSE Only} - Asm84CEPrgm
^{CE Only} - augment(
- AUTO Answer
- AxesOff
- AxesOn
- a+bi

# B

# C

- checkTmr(
- χ²cdf(
- χ²pdf(
- χ²-Test(
- χ²GOF-Test(
- Circle(
- CLASSIC
- Clear Entries
- ClockOff
- ClockOn
- ClrAllLists
- ClrDraw
- ClrHome
- ClrList
- ClrTable
- conj(
- Connected
- CoordOff
- CoordOn
- cos(
- cosֿ¹(
- cosh(
- coshֿ¹(
- CubicReg
- cumSum(

# D

- dayOfWk(
- dbd(
- DEC Answer
- ►Dec
- Degree
- DelVar
- DependAsk
- DependAuto
- det(
- DetectAsymOff
- DetectAsymOn
- DiagnosticOff
- DiagnosticOn
- dim(
- Disp
- DispGraph
- DispTable
- ►DMS
- Dot
- Dot-Thick
- Dot-Thin
- DrawF
- DrawInv
- DS<(

# E

# F

# G

- GarbageCollect
- gcd(
- geometcdf(
- geometpdf(
- Get(
- GetCalc(
- getDate
- getDtFmt
- getDtStr(
- getKey
- getTime
- getTmFmt
- getTmStr(
- Goto
- GraphColor(
- GraphStyle(
- GridOff
- GridOn
- G-T

# H

# I

*i*- identity(
- If
- imag(
- IndpntAsk
- IndpntAuto
- Input
- inString(
- int(
- ΣInt(
- invNorm(
- invT(
- iPart(
- irr(
- IS>(
- IsClockOn

# L

- ∟
- LabelOff
- LabelOn
- Lbl
- lcm(
- length(
- Line(
- LinReg(a+bx)
- LinReg(ax+b)
- LinRegTInt
- LinRegTTest
- ΔList(
- List►matr(
- ln(
- LnReg
- log(
- logBASE(
- Logistic

# M

# N

# O

# P

- Param
- Pause
- piecewise(
^{CE OS 5.3} - Plot1(
- Plot2(
- Plot3(
- PlotsOff
- PlotsOn
- Pmt_Bgn
- Pmt_End
- poissoncdf(
- poissonpdf(
- Polar
- ►Polar
- PolarGC
- prgm
- ΣPrn(
- prod(
- Prompt
- Pt-Change(
- Pt-Off(
- Pt-On(
- PwrReg
- Pxl-Change(
- Pxl-Off(
- Pxl-On(
- pxl-Test(
- P►Rx(
- P►Ry(

# Q

# R

- Radian
- rand
- randBin(
- randInt(
- randIntNoRep(
- randM(
- randNorm(
- Rcl
- re^θi
- Real
- real(
- RecallGDB
- RecallPic
- ►Rect
- RectGC
- ref(
- remainder(
- Repeat
- Return
- round(
- *row(
- row+(
- *row+(
- rowSwap(
- rref(
- R►Pr(
- R►Pθ(

# S

- Scatter
- Sci
- Select(
- Send(
- seq(
- Seq
- Sequential
- setDate(
- setDtFmt(
- setTime(
- setTmFmt(
- SetUpEditor
- Shade(
- Shadeχ²(
- ShadeF(
- ShadeNorm(
- Shade_t(
- Simul
- sin(
- sinֿ¹(
- sinh(
- sinhֿ¹(
- SinReg
- solve(
- SortA(
- SortD(
- startTmr
- statwizard-off
- statwizard-on
- stdDev(
- Stop
- StoreGDB
- StorePic
- String►Equ(
- sub(
- sum(
- summation Σ(

# T

- tan(
- tanֿ¹(
- Tangent(
- tanh(
- tanhֿ¹(
- tcdf(
- Text(
- TextColor(
- Then
- Thick
- Thin
- Time
- timeCnv(
- TInterval
- toString(
^{CE OS 5.2} - tpdf(
- Trace
- T-Test
- tvm_FV
- tvm_I%
- tvm_N
- tvm_Pmt
- tvm_PV

# U

# V

# W

# X

# Z

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/command-index

Overview of Commands

The TI-Basic programming language features a wide range of commands for all kinds of things, including output, user input, manipulating variables, linking calculators, and especially math — don't forget a calculator is primarily designed for doing math. In total, there are almost 400 commands on the TI-83+ calculators, and the TI-84+/SE calculators have an additional 22 commands (because of the new time and date commands and the new math commands added in OS 2.30).

Because sorting through all of these commands is a rather daunting task, especially when trying to figure out which one is appropriate for accomplishing a desired task, we have chosen to present them in three different formats:

**Alphabetical Index**— A listing of the commands sorted in alphabetical order.**Menu Map**— A listing of the commands sorted by where they appear in their different menus on the calculator.**Category**— A listing of the related commands grouped together based on their common function and purpose.

There are eleven different command categories that we have come up with:

We tried to do our best to come up with these categories because we believe they reflect the natural divisions of the commands, although some of the commands have functionality that overlaps more than one category. In this case, we decided to simply go with the primary use of the command.

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/commands

Summationsigma

This command will open up a template that allows you to evaluate an expression in sigma notation.

This command is accessible by pressing ALPHA then WINDOW then 2.

This command is especially useful for statistics and algebra.

It is also available in the programming mode. You can access it either through the catalog or the same way specified above.

The syntax for this command is

`Σ(Expression,Variable,Starting number,Ending number)`

An example would be to determine the sum of 2*X for X going from 1 to 10.

It would look like this:

`Σ(2X,X,1,10`

The result would be

`110`

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/summationsigma

The ^ Command

The ^ operator is used to raise a number to a power. It can be used with numbers, expressions, and lists. It can be used for taking nonnegative integer powers of square matrices (up to the 255th power only, however), but not for negative powers (use ֿ¹ instead) or matrix exponentials (which the TI-83+ cannot do).

In general, *x*^*y* returns the same results as *e*^(*y**ln(*x*)). For expressions of the form *x*^(*p**/q*), where *p* and *q* are integers and *q* is an odd number, the principal branch is returned if *x* is complex, but the real branch is returned if *x* is a negative real number.

```
(-1)^(1/3)
-1
(-1+0i)^(1/3)
.5+.8660254038i
```

# Optimization

When raising 10 or *e* to a power, use the 10^( and *e^(* commands instead. Similarly, use the ², ³, or ֿ¹ commands for raising a number to the 2, 3, or -1 power.

# Error Conditions

**ERR:DOMAIN**is thrown when calculating 0^0, or raising 0 to a negative power.**ERR:NONREAL ANS**is thrown in Real mode if the result is complex (and the operands are real)

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/power

The ^ Command

Raises a number to a power.

*base* ^ *exponent*

**Menu Location**

Press the [^] key to paste ^.

This command works on all calculators.

1 byte

The ^ operator is used to raise a number (the base) to a power (the exponent) — x^y is "pretty-printed" as x^{y}. When the exponent is a positive integer, this is equivalent to multiplying the base by itself that many times.

When the base is a real number, the result will always be a real number if possible: for example (-1)^(1/3) will return -1. Some powers will return a complex number because there *is* no real number answer (or give an error, if the calculator is in real number mode). When the base is a complex number, the result will be the principal branch.

For lists, the ^ operator works componentwise — x^{a,b,c,…} will return {x^a,x^b,x^c,…}, {x,y,z,…}^a will return {x^a,y^a,z^a,…}, and two lists of the same length will be matched up element by element.

```
:2^4
16
:(-1)^(1/2)
i
:0^0
undef
```

Typing [2nd] [LN] or [♦] [LN] also pastes *e*^( — this is not a separate command (unlike the TI-83 series), and just uses the ^ operator to do its work. It is, however, the simplest way to type the constant *e*.

A minor quirk of the ^ operator is that if it's present multiple times in one expression, it is evaluated right to left (unlike most commands, which are evaluated left to right). For example, x^y^z will be interpreted as x^(y^z) rather than (x^y)^z. The reason this is done is that (x^y)^z can easily be rewritten as x^(y*z), so there's no need for two powers. x^(y^z) can't be rewritten that way. Therefore, it's much more meaningful to interpret x^y^z as x^(y^z).

# Advanced Uses

The ^ operator can be used as an alternative to an "xth root" operator, which the 68k calculators don't have. If you want to take the Nth root of a number, raise it to the 1/N-th power instead.

The ^ operator is also useful for square matrices. Raising a square matrix to an integer power between -32768 and 32767 just multiples the matrix by itself, taking the inverse first for negative matrices. A matrix to the 0th power is the identity.

For raising a matrix to a fractional power, or raising a number to a matrix power, a different definition is used: see Matrices and Their Commands. This definition is in fact compatible with the repeated-multiplication method, except that it is far more general.

None of these situations are equivalent to applying ^ to every element of a matrix. For that, see the .^ command.

# Error Conditions

**230 - Dimension** happens when non-square matrices are used with ^.

**230 - Domain error** happens when a matrix is raised to an integer power not in the range -32768..32767.

**665 - Matrix not diagonalizable** happens when diagonalization (used to compute most uses of ^ with matrices) fails.

**800 - Non-real result** happens when there is no real result to return, and the calculator is in real number mode.

**890 - Singular matrix** happens when raising a matrix with no inverse to a negative power.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:power

The ×√ Command

Takes the *x*th root of an input.

*A* ^{x}√ *B*

While editing a program, press:

- MATH to open the math menu
- 5 or use the arrow keys to select

TI-83/84/+/SE

1 byte

This command takes the *x*th root of a number. If used on a list, it will return a list with the *x*th root of each element. Also valid are the forms *list*^{×}√*x* and *list1*^{×}√*list2*.

```
:2×√4
2
:5×√2
1.148698355
:3×√{1,‾8,27}
{1 ‾2 3}
:{3,2}×√{8,9}
{2 3}
Real mode:
:4×√‾1
<returns error>
a+bi mode:
:4×√‾1
.7071067812+.7071067812i
```

See the notes on the ^ command for an explanation on how ^{×}√ behaves depending on whether its input is real or complex.

# Optimization

If you want to take the second or third root of a number, use √( or ³√( instead.

```
:2×√X
can be
:√(X
```

# Error Conditions

**ERR:NONREAL ANS**if you try to take an even root of a negative number or list element in Real mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/xroot

The ≠ Command

Returns true if value1 is not equal to value2.

*value1*≠*value2*

Press:

- 2nd TEST to access the test menu.
- 2 to select ≠, or use arrows.

TI-83/84/+/SE

1 byte

The ≠ (not equal) operator takes two numbers, variables, or expressions, and tests to see if they are not equal to each other. It will return 1 if they are not, and 0 if they are. When determining the order of operations, ≠ will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

```
1≠0
1
0→X
0
3→Y
3
X≠Y
1
```

# Advanced Uses

Just like the other relational operators, ≠ can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

```
:{2,4,6,8}≠{1,3,5,7
{1 1 1 1}
:5≠{1,2,3,4,5
{1 1 1 1 0}
```

Besides real numbers and lists, ≠ also allows you compare strings, matrices, and complex numbers. However, the variables must be of the same type, otherwise the calculator will throw a ERR:DATA TYPE error; and just like with lists, both matrices must have the same dimensions, otherwise you will get a ERR:DIM MISMATCH error.

```
:[[1,2,3]]≠[[1,2,3
0
:"HELLO"≠"WORLD
1
:(3+4i)≠(5-2i) (the parentheses are added for clarity)
1
```

# Optimization

Don't compare a variable's value to zero in a conditional expression, because the calculator treats nonzero values as true and zero as false. Instead, just write the variable by itself:

```
:If C≠0
can be
:If C
```

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to compare two different kinds of variables, such as a string and number or a list and matrix.**ERR:DIM MISMATCH**is thrown if you try to compare two lists or matrices that have different dimensions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/notequal

The ≠ Command

Tests if two values are different.

*value1*≠*value 2*

**Menu Location**

Press [♦][=] key to enter ≠.

This command works on all calculators.

1 byte

The ≠ operator compares two values, returning true if they're different, and false if they're equal. It is a basic building block of the conditions used by commands such as If, when(), and While. The results of ≠ and the other relational operators (=, >, ≥, <, and ≤) can be combined with the and, or, xor, and not operators to create more complicated conditions.

It returns a single value for most types of data, and returns true if the two sides are mismatched in type: comparing a single number to a list, for instance, or comparing two lists that are of a different size. The only exception is when comparing two lists or two matrices of the same size: in that case, it compares them element-by-element, and returns a list or matrix of true/false values.

```
:2+2≠4
false
:2+2≠5
true
:{1,2,3}≠{1,4,3}
{false true false}
```

If either side or both contains undefined variables, ≠ will wait to return a value unless it's something clearly true or false for any value of the variable (for instance, x≠x). You can do math with the resulting inequality: if an operation makes sense, it will be applied to both sides: for instance, if x≠y, then you can negate it to get -x≠-y. An operation will not be applied to both sides if it wouldn't be consistent with the previous inequality: for example, you can't square both sides, since if x≠y it can still be the case that x^2=y^2. You can also extract the two halves of the inequality with left() and right().

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:not-equal

The < Command

Returns true if value1 is less than value2.

*value1*<*value2*

Press:

- 2nd TEST to access the test menu.
- 5 to select <, or use arrows.

TI-83/84/+/SE

1 byte

The < (less than) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value less than the second one. It will return 1 if it is less than, and 0 if it is not. When determining the order of operations, < will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

```
:1<0
0
:DelVar X3→Y
:X<Y
1
```

# Advanced Uses

Just like the other relational operators, < can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

```
:{2,4,6,8}<{1,3,5,7
{0 0 0 0}
:5<{1,2,3,4,5
{0 0 0 0 0}
```

Unfortunately, < does not work with strings, matrices, or complex numbers (only = and ≠ do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to compare strings, matrices, or complex numbers.**ERR:DIM MISMATCH**is thrown if you try to compare two lists that have different dimensions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/lessthan

The < Command

Tests if one value is smaller than another.

*value1*<*value 2*

**Menu Location**

Press [2nd][<] to enter <.

This command works on all calculators.

1 byte

The < operator compares two values, returning true if the right side is greater, and false otherwise. It is a basic building block of the conditions used by commands such as If, when(), and While. The results of < and the other relational operators (=, ≠, >, ≥, and ≤) can be combined with the and, or, xor, and not operators to create more complicated conditions.

It returns a single value for most types of data, and returns false if the two sides are mismatched in type: comparing a single number to a list, for instance, or comparing two lists that are of a different size. The only exception is when comparing two lists or two matrices of the same size: in that case, it compares them element-by-element, and returns a list or matrix of true/false values.

```
:3<4
true
:3<2
false
:{1,2,3}<{3,2,1}
{true false false}
```

If either side or both contains undefined variables, < will wait to return a value. You can do math with the resulting inequality, and if an operation makes sense, it will be applied to both sides: for instance, if x<y, then you can negate it to get -x>-y. An operation will not be applied to both sides if it wouldn't be consistent with the previous inequality: for example, you can't square both sides, since even if x<y the comparison between x^2 and y^2 could go in any order. You can also extract the two halves of the inequality with left() and right().

# Advanced Uses

The < operator can also compare strings. It does so by comparing the character codes of each character, and orders the strings by the first difference it finds. This ideally means that the strings are ordered by dictionary order: for example, "aardvark"<"apple", since it would come later in the dictionary.

However, the problem is that all uppercase letters have a smaller character code than lowercase letters, so this only holds true if the strings are the same case. Otherwise, strange results can happen: for instance, "Apple"<"aardvark", since "A" comes before "a".

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:less-than

The ≤ Command

Returns true if value1 is less than or equal to value2.

*value1*≤*value2*

Press:

- 2nd TEST to access the test menu.
- 6 to select ≤, or use arrows.

TI-83/84/+/SE

1 byte

The ≤ (less than equal) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value less than or equal to the second one. It will return 1 if it is less than or equal to, and 0 if it is not. When determining the order of operations, ≤ will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

```
:1≤0
0
:DelVar X3→Y
:X≤Y
1
```

# Advanced Uses

Just like the other relational operators, ≤ can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

```
:{2,4,6,8}≤{1,3,5,7
{0 0 0 0}
:5≤{1,2,3,4,5
{0 0 0 0 1}
```

Unfortunately, ≤ does not work with strings, matrices, or complex numbers (only = and ≠ do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to compare strings, matrices, or complex numbers.**ERR:DIM MISMATCH**is thrown if you try to compare two lists that have different dimensions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/lessthanequal

The ≤ Command

Tests if one value is smaller than or equal to another.

*value1*≤*value 2*

**Menu Location**

Press [♦][<] to enter ≤.

This command works on all calculators.

1 byte

The ≤ operator compares two values, returning true if the right side is greater or if the two are equal, and false otherwise. It is a basic building block of the conditions used by commands such as If, when(), and While. The results of ≤ and the other relational operators (=, ≠, >, ≥, and <) can be combined with the and, or, xor, and not operators to create more complicated conditions.

It returns a single value for most types of data, and returns false if the two sides are mismatched in type: comparing a single number to a list, for instance, or comparing two lists that are of a different size. The only exception is when comparing two lists or two matrices of the same size: in that case, it compares them element-by-element, and returns a list or matrix of true/false values.

```
:3≤4
true
:3≤2
false
:{1,2,3}≤{3,2,1}
{true true false}
```

If either side or both contains undefined variables, ≤ will wait to return a value. You can do math with the resulting inequality, and if an operation makes sense, it will be applied to both sides: for instance, if x≤y, then you can negate it to get -x≥-y. An operation will not be applied to both sides if it wouldn't be consistent with the previous inequality: for example, you can't square both sides, since even if x≤y the comparison between x^2 and y^2 could go in any order. You can also extract the two halves of the inequality with left() and right().

# Advanced Uses

The ≤ operator can also compare strings. It does so by comparing the character codes of each character, and orders the strings by the first difference it finds. This ideally means that the strings are ordered by dictionary order: for example, "aardvark"≤"apple", since it would come later in the dictionary.

However, the problem is that all uppercase letters have a smaller character code than lowercase letters, so this only holds true if the strings are the same case. Otherwise, strange results can happen: for instance, "Apple"≤"aardvark", since "A" comes before "a".

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:less-than-or-equal

The = Command

Returns true if value1 is equal to value2.

*value1*=*value2*

Press:

- 2nd TEST to access the test menu.
- 1 to select =, or use arrows.

TI-83/84/+/SE

1 byte

The `=` (equal) operator takes two numbers, variables, or expressions, and tests to see if they are equal to each other. It will return 1 if they are, and 0 if they are not. When determining the order of operations, `=` will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

```
1=0
0
0->X
0
3→Y
3
X=Y
0
```

# Advanced Uses

Just like the other relational operators, = can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

```
{2,4,6,8}={1,3,5,7
{0 0 0 0}
5={1,2,3,4,5
{0 0 0 0 1}
```

Besides real numbers and lists, `=` also allows you compare strings, matrices, and complex numbers. However, the variables must be of the same type, otherwise the calculator will throw a ERR:DATA TYPE error.

```
[[1,2,3]]=[[1,2,3
1
"HELLO"="WORLD
0
(3+4i)=(5-2i)
0
```

When matrices are compared, the result is `1` if the matrices are identical. Both matrices must have the same dimensions, otherwise you will get a ERR:DIM MISMATCH error. Internally, the calculator compares values from the bottom right of each matrix, moving left across each row from bottom to top. If unequal elements are found, the calculator returns 0 without examining the rest of the matrix.

# Optimization

When a variable is used in a conditional statement, and the only values that are possible for a variable are 1 and 0, you can get rid of the `=` sign and simply use the variable by itself.

```
:If X=1
can be
:If X
```

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to compare two different kinds of variables, such as a string and number or a list and matrix.**ERR:DIM MISMATCH**is thrown if you try to compare two lists or matrices that have different dimensions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/equal

The = Command

Tests if two values are equal.

*value1*=*value 2*

**Menu Location**

Press the [=] key to enter =.

This command works on all calculators.

1 byte

The = operator compares two values, returning true if they're equal, and false otherwise. It is a basic building block of the conditions used by commands such as If, when(), and While. The results of = and the other relational operators (≠, >, ≥, <, and ≤) can be combined with the and, or, xor, and not operators to create more complicated conditions.

It returns a single value for most types of data, and returns false if the two sides are mismatched in type: comparing a single number to a list, for instance, or comparing two lists that are of a different size. The only exception is when comparing two lists or two matrices of the same size: in that case, it compares them element-by-element, and returns a list or matrix of true/false values.

```
:2+2=4
true
:2+2=5
false
:{1,2,3}={1,4,3}
{true false true}
```

If either side or both contains undefined variables, = will wait to return a value unless it's something clearly true for any value of the variable (for instance, x=x). You can do math with the resulting equation (most operations will be applied to both sides), and extract the two halves of it with left() and right().

# Optimization

Testing "If x=true" is redundant in most cases; you can shorten that to "If x". Similarly, "If x=false" can be "If not x".

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:equal

The ≥ Command

Returns true if value1 is greater than or equal to value2.

*value1*≥*value2*

Press:

- 2nd TEST to access the test menu.
- 4 to select ≥, or use arrows.

TI-83/84/+/SE

1 byte

The `≥` (greater than equal) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value greater than or equal to the second one. It will return 1 if it is greater than or equal to, and 0 if it is not. When determining the order of operations, `≥` will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

```
:1≥0
1
:DelVar X3→Y
:X≥Y
0
```

# Advanced Uses

Just like the other relational operators, `≥` can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

```
:{2,4,6,8}≥{1,3,5,7
{1 1 1 1}
:5≥{1,2,3,4,5
{1 1 1 1 1}
```

Unfortunately, `≥` does not work with strings, matrices, or complex numbers (only `=` and `≠` do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to compare strings, matrices, or complex numbers.**ERR:DIM MISMATCH**is thrown if you try to compare two lists that have different dimensions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/greaterthanequal

The ≥ Command

Tests if one value is larger than or equal to another.

*value1*≥*value 2*

**Menu Location**

Press [♦][>] to enter ≥.

This command works on all calculators.

1 byte

The ≥ operator compares two values, returning true if the left side is greater or if the two are equal, and false otherwise. It is a basic building block of the conditions used by commands such as If, when(), and While. The results of ≥ and the other relational operators (=, ≠, >, <, and ≤) can be combined with the and, or, xor, and not operators to create more complicated conditions.

```
:3≥4
false
:3≥2
true
:{1,2,3}≥{3,2,1}
{false true true}
```

If either side or both contains undefined variables, ≥ will wait to return a value. You can do math with the resulting inequality, and if an operation makes sense, it will be applied to both sides: for instance, if x≥y, then you can negate it to get -x≤-y. An operation will not be applied to both sides if it wouldn't be consistent with the previous inequality: for example, you can't square both sides, since even if x≥y the comparison between x^2 and y^2 could go in any order. You can also extract the two halves of the inequality with left() and right().

# Advanced Uses

The ≥ operator can also compare strings. It does so by comparing the character codes of each character, and orders the strings by the first difference it finds. This ideally means that the strings are ordered by dictionary order: for example, "apple"≥"aardvark", since it would come later in the dictionary.

However, the problem is that all uppercase letters have a smaller character code than lowercase letters, so this only holds true if the strings are the same case. Otherwise, strange results can happen: for instance, "aardvark"≥"Apple", since "a" comes after "A".

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:greater-than-or-equal

The > Command

Returns true if value1 is greater than value2.

*value1*>*value2*

Press:

- 2nd TEST to access the test menu.
- 3 to select >, or use arrows.

TI-83/84/+/SE

1 byte

The > (greater than) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value greater than the second one. It will return 1 if it is greater, and 0 if it is not. When determining the order of operations, > will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

```
:1>0
1
:DelVar X3→Y
:X>Y
0
```

# Advanced Uses

Just like the other relational operators, > can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

```
:{2,4,6,8}>{1,3,5,7
{1 1 1 1}
:5>{1,2,3,4,5
{1 1 1 1 0}
```

Unfortunately, > does not work with strings, matrices, or complex numbers (only = and ≠ do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to compare strings, matrices, or complex numbers.**ERR:DIM MISMATCH**is thrown if you try to compare two lists that have different dimensions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/greaterthan

The > Command

Tests if one value is larger than another.

*value1*>*value 2*

**Menu Location**

Press [2nd][>] to enter >.

This command works on all calculators.

1 byte

The > operator compares two values, returning true if the left side is greater, and false otherwise. It is a basic building block of the conditions used by commands such as If, when(), and While. The results of > and the other relational operators (=, ≠, ≥, <, and ≤) can be combined with the and, or, xor, and not operators to create more complicated conditions.

```
:3>4
false
:3>2
true
:{1,2,3}>{3,2,1}
{false false true}
```

If either side or both contains undefined variables, > will wait to return a value. You can do math with the resulting inequality, and if an operation makes sense, it will be applied to both sides: for instance, if x>y, then you can negate it to get -x<-y. An operation will not be applied to both sides if it wouldn't be consistent with the previous inequality: for example, you can't square both sides, since even if x>y the comparison between x^2 and y^2 could go in any order. You can also extract the two halves of the inequality with left() and right().

# Advanced Uses

The > operator can also compare strings. It does so by comparing the character codes of each character, and orders the strings by the first difference it finds. This ideally means that the strings are ordered by dictionary order: for example, "apple">"aardvark", since it would come later in the dictionary.

However, the problem is that all uppercase letters have a smaller character code than lowercase letters, so this only holds true if the strings are the same case. Otherwise, strange results can happen: for instance, "aardvark">"Apple", since "a" comes after "A".

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:greater-than

The | Command

Substitutes a value for a variable temporarily.

*expression*

**Menu Location**

Press the

This command works on all calculators.

1 byte

The | operator (which nobody seems to know how to pronounce, although TI suggests "with") temporarily sets a variable to some value, just for a single evaluation. For example:

```
:x^2+2x+1|x=5
6
```

Using the | operator doesn't actually affect the value of the variable. However, it will work both if the variable is undefined, and if the variable already has a different value.

Only one | can occur in a single expression: if you have more, this will either cause an error or ignore all but the first substitution, depending on placement. However, one | is enough for any number of variables: just separate the values to use with and:

```
:x+y|x=2 and y=2
4
```

# Advanced Uses

The | operator has a more complicated use: rather than giving a specific value for a variable, you might give a condition (or several conditions) for its value, using the >, ≥, <, and ≤ operators. This condition will be used if it helps simplify the expression, especially with solve(). For instance:

```
:abs(x)|x<0
-x
```

Weird things can happen if you do this to a variable whose value is already defined, however:

```
:5→x
5
:abs(x)|x<0
|undef|
```

# Optimization

If a complicated expression has a repeating element, you may be able to make the calculation smaller and faster by replacing this repeating element with a variable, for which you substitute the correct value. For example (here the repeating element is √(1-x^2)):

```
:x√(1-x^2)+tanֿ¹(x/√(1-x^2))
can be
:x*a+tanֿ¹(x/a)|a=√(1-x^2)
```

A related trick is to make a substitution with a function, for an operation that has to be done several times in a single line. For example:

```
:a*(a-1)/2+b*(b-1)/2+c*(c-1)/2
can be
:f(a)+f(b)+f(c)|f(x)=x*(x-1)/2
```

# Error Conditions

**200 - Constraint expression invalid** happens when the condition doesn't make sense to the calculator.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:with

The ° Command

Converts an angle to degrees, if necessary.

*angle*°

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press 2 to enter the Angle submenu.
- Press 1 to select °.

This command works on all calculators.

2 bytes

The ° symbol used after an angle makes sure the angle is interpreted as being in degrees. If the calculator is already in degree mode, x° is equal to x; in radian mode, x° is equal to π*x/180; and in gradian mode, x° is equal to 10*x/9.

If you're using degree measure extensively in a program, it's a better idea to use setMode() to switch to degree mode and not worry about this. However, there are two reasons you might want to use °:

- If you need an angle in degrees only once or twice, don't bother changing the mode setting.
- In a function, you're forced to use °, since setMode() isn't valid in a function.

In radian mode:

```
:sin(30)
sin(30)
:sin(30°)
1/2
:180°
π
```

In degree mode (no conversion is necessary, so no conversion is done):

```
:sin(30)
1/2
:sin(30°)
1/2
:180°
180
```

Another possible use of ° is to write an angle in degrees, minutes, and seconds as x°y'z" (using the usual apostrophe and quote symbols) — this stands for x degrees, y minutes (equal to 1/60th of a degree) and z seconds (equal to 1/60th of a minute). There's no "degree/minute/second" mode setting, so an angle entered in this form will always be simplified: first to (x+y/60+z/3600)^{2} degrees, and then (if necessary) converted to the correct angle measure. However, you can use ▶DMS to express output in this form.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:degree

The - Command

The - (subtract) operator takes two numbers, variables, or expressions and subtracts one from the other, thus returning the difference between them. The - operator appears lower in the order of operations than both * and /, so if those appear in an expression, they will be executed first. In addition, the + operator has the same order of operations as -, so the calculator simply executes them left to right in the order that they appear.

```
:1-1
0
:5→X
:2-3X
-13
:2→A:3→B
:A/B-B/A
-.8333333333
```

# Error Conditions

**ERR:SYNTAX**is thrown if you try to use - (subtract) in place of ‾ (negative). Because they look very similar, it's easy to get this error; at the same time, it's an easy error to fix.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/subtract

The - Command

Returns the difference of two numbers.

*value1* - *value2*

**Menu Location**

Press the [-] key to paste -.

This command works on all calculators.

1 byte

The - operator subtracts two numbers, variables, or expressions. Order of operations dictates that it's calculated after * and /, and at the same time as +.

The - operator can also be used on lists and matrices. For the most part, it behaves in the intuitive way, distributing the operation over each element. However, subtracting a number from a matrix (or a matrix from a number) behaves differently: the number is only subtracted along the main diagonal of the matrix. For "normal" subtraction that applies to every element of the matrix, see .-.

```
:1-1
0
:5→x
:2-3x
-13
:[1,2;3,4]-100
[-99 2]
[3 -96]
```

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:subtract

The ! Command

Calculates the factorial of a number or list.

*value*!

Press:

- MATH to access the math menu.
- LEFT to access the PRB submenu.
- 4 to select !, or use arrows.

TI-83/84/+/SE

1 byte

! is the factorial function, where *n*! = *n**(*n*-1)! and 0! = 1, *n* an nonnegative integer. The function also works for arguments that are half an odd integer and greater than -1/2: $(-\frac1{2})!$ is defined as $\sqrt{\pi}$ and the rest are defined recursively. 69 is the largest number for which the calculator can perform the operation.

```
3!
6
(‾.5)!
1.772453851
Ans²
3.141592654
```

The combinatorial interpretation of factorials is the number of ways to arrange *n* objects in order.

# Error Conditions

**ERR:DOMAIN**for any numbers except the ones mentioned above.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/factorial

The ! Command

Takes the factorial of a number.

*number*!

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

1 byte

The ! operator takes the factorial of a number: for a positive, whole number, n! is defined as n*(n-1)*(n-2)*…*3*2*1. As a special case, 0! is defined to be 1.

The factorial has a special meaning in combinatorics: n! is the number of ways you can order n objects. For instance, 3!=6 because there are 6 ways to order 3 objects:

- A B C
- A C B
- B A C
- B C A
- C A B
- C B A

As can be expected, factorials get very large very quickly. The calculator can only compute an exact integer result for factorials up to 299!, and an approximate result for factorials up to 449!. Beyond that, the numbers involved are replaced by ∞ (infinity) in expressions.

While there are some formulas to define factorials of non-integer values, the calculator doesn't use them. It will leave an expression like (1/2)! unsimplified. However, the factorial of a number less than or equal to -1 will be "undef".

```
:5!
120
:299!
1020191707388... (600 more digits)
:449!
3.85193e997
:(-2)!
undef
```

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:factorial

The / Command

The / (divide) operator takes two numbers, variables, or expressions and divides them, thus returning a single new value. The / operator appears higher in the order of operations than both + and -, so if those appear in an expression, / will be executed first. In addition, the * operator has the same order of operations as /, so the calculator simply executes them left to right in the order that they appear.

```
:1/1
1
:5→X
:2/3X
3.333333333
:2→A:3→B
:A/B/B/A
.1111111111
```

# Related Commands

# Error Conditions

**ERR:DATA TYPE**is thrown if you divide by a matrix.**ERR:DIVIDE BY 0**is thrown if you divide by 0 or a undefined variable.

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/divide

The / Command

Divides one number by another.

value1 / value2

**Menu Location**

Press the [/] key to paste /.

This command works on all calculators.

1 byte

The / operator divides two numbers, variables, or expressions. It has higher priority than + and -, so it will be done before them; it has the same priority as *.

```
:x/y
x/y
:2/2
1
```

Though division by zero isn't allowed, it will not cause an error; instead it returns the value undef — short for "undefined." Dividing by a variable that hasn't been defined yet will cancel it if it occurs on both sides: 5*x/x will equal 5; a short warning will be given to the effect that this isn't valid for x=0.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:divide

The .^ Command

Raises a value to a power, doing this element-by-element for matrices.

*base* .^ *exponent*

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press 4 to enter the Matrix submenu.
- Press K to enter the Element ops submenu.
- Press 1 to select .+.

…frankly, just typing it is way easier.

This command works on all calculators.

1 byte

The .^ operator is generally the same as ^, except when dealing with matrices. While ^ does quite a lot of matrix-specific stuff (check out its page for more information), .^ just applies it element-by-element:

```
:[a,b;c,d] .^ 2
[a^2 b^2]
[c^2 d^2]
```

The command can handle any choice of matrix and scalar as the base and exponent. However, if you're raising a constant number to a matrix power, be careful that the dot in .^ is not confused for a decimal point, by adding extra spaces:

```
:2.^[a,b;c,d]
Error: Data type
:2 .^ [a,b;c,d]
[2^a 2^b]
[2^c 2^d]
```

Although this doesn't come up often, be aware that .^, like ^, is evaluated from right to left: a.^b.^c is calculated as a.^(b.^c), not as (a.^b).^c.

# Error Conditions

**240 - Dimension mismatch** happens when a matrix is raised to the power of another matrix, with different dimensions.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dotpower

The .- Command

Subtracts two values, using element-by-element subtraction when subtracting a matrix and a number.

*value1* .- *value2*

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press 4 to enter the Matrix submenu.
- Press K to enter the Element ops submenu.
- Press 2 to select .-.

…frankly, just typing it is way easier.

This command works on all calculators.

1 byte

The .- command works like plain - in most cases, taking the difference of two values. It's distinguished by its application to matrices: in particular, when subtracting a matrix and a scalar (in either order). Normally, the operation will be done along the main diagonal only: as though the value were multiplied by the identity matrix. However, .- does the more intuitive thing (for anyone but an algebraist, anyway) and subtracts the value from every element of the matrix (or, if the matrix is being subtracted, subtracts every element from the scalar value).

```
:[a,b;c,d]-x
[-x+a b ]
[c -x+d]
:[a,b;c,d].-x
[-x+a -x+b]
[-x+c -x+d]
```

It doesn't really make much sense to use .- to add other kinds of values, but you can do it if you like.

When subtracting a matrix from a constant number, be warned that the . may be interpreted as a decimal point. You can put spaces to help the calculator figure out what you mean.

```
:5.-[a,b;c,d]
[-a+5. -b ]
[-c -d+5.]
:5 .+ [a,b;c,d]
[-a+5 -b+5]
[-c+5 -d+5]
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dotsubtract

The ./ Command

Divides two values, doing so element-by-element for two matrices.

*value* ./ *value*

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press 4 to enter the Matrix submenu.
- Press K to enter the Element ops submenu.
- Press 4 to select ./.

…frankly, just typing it is way easier.

This command works on all calculators.

1 byte

The ./ operator works just like / in most cases. The only exception is with matrices. The / command can't do anything with then (except for dividing a matrix by a value), but ./ will just apply the operation element-by-element. Obviously, when this is done for two matrices, their dimensions have to match up.

```
:[a,b;c,d] ./ [e,f;g,h]
[a/e b/f]
[c/g d/h]
```

When dividing a constant number by a matrix with ./, you may need to space it out so that there's no confusion between ./ and a decimal point.

```
:1./[a,b;c,d]
Error: Data type
:1 ./ [a,b;c,d]
[1/a 1/b]
[1/c 1/d]
```

# Error Conditions

**240 - Dimension mismatch** happens when dividing a matrix by another matrix of a different size.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dotdivide

The .* Command

Multiples two values, using element-by-element multiplication for two matrices.

*value1* .* *value2*

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press 4 to enter the Matrix submenu.
- Press K to enter the Element ops submenu.
- Press 3 to select .*.

…frankly, just typing it is way easier.

This command works on all calculators.

1 byte

In most cases, .* does the same thing as *. The difference only applies to multiplying two matrices. Whereas * uses the linear-algebra definition (see its article for details), .* does the simple thing and multiplies the matrices element by element (obviously, they must match in size for this to work).

```
:[1,2;3,4] .* [a,b;c,d]
[a 2*b]
[3*c 4*d]
```

# Error Conditions

**240 - Dimension mismatch** happens when the matrices being multiplied don't match in size.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dotmultiply

The .+ Command

Adds two values, using element-by-element addition when adding a matrix and a number.

*value1* .+ *value2*

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press 4 to enter the Matrix submenu.
- Press K to enter the Element ops submenu.
- Press 1 to select .+.

…frankly, just typing it is way easier.

This command works on all calculators.

1 byte

The .+ command works like plain + in most cases, adding two values together. It's distinguished by its application to matrices: in particular, when adding a matrix and a scalar. Normal addition of a matrix and a single value will add that value along the main diagonal only: as though the value were multiplied by the identity matrix. However, .+ does the more intuitive thing (for anyone but an algebraist, anyway) and adds the value to every element of the matrix.

```
:[a,b;c,d]+x
[x+a b ]
[c x+d]
:[a,b;c,d].+x
[x+a x+b]
[x+c x+d]
```

It doesn't really make much sense to use .+ to add other kinds of values, but you can do it if you like.

Although the order of the matrix and the scalar doesn't matter, be warned that in some cases, the . will be interpreted as a decimal point. You can put spaces to help the calculator figure out what you mean.

```
:5.+[a,b;c,d]
[a+5. b ]
[c d+5.]
:5 .+ [a,b;c,d]
[a+5 b+5]
[c+5 d+5]
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dotadd

The © Command

Marks the rest of the line (in a program) as a comment.

:*line of code* © *comment*

**Menu Location**

Starting in the program editor:

- Press F2 to enter the I/O menu.
- Press 9 to select ©.

This command works on all calculators.

4 bytes (+ length of comment)

The © character is used for adding comments in a program: everything after © is ignored by the calculator for the purposes of actually running the program, so it's a good way to make a note to yourself about what a part of your code does. This is especially helpful if you're going to be reading the program later when you don't quite remember what you were doing.

```
:If ok=0 © If the user pressed ESC
: Stop
```

There are other situations you might use comments in. For instance, you might make a rough sketch of your program and add comments about the code that has yet to be filled in:

```
:If key=264 Then
: © add a confirmation dialog here later
: Exit
:EndIf
```

Yet another use of © is to "comment out" lines of code that you might need later, but want to ignore for now — this is better than deleting the code, since you don't have to rewrite it later.

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:comment

The * Command

The * (multiply) operator takes two numbers, variables, or expressions and multiplies their values together, thus returning a single new value. The * operator appears higher in the order of operations than both + and -, so if those appear in an expression, * will be executed first. In addition, the / operator has the same order of operations as *, so the calculator simply executes them left to right in the order that they appear.

```
:1*1
1
:5→X
:2*3X
30
:2→A:3→B
:A/B*B/A
1
```

# Advanced Uses

As it turns out, the most advanced way to use * is by not using it at all. On z80-based TI calculators, two adjacent expressions or variables are implicilty multiplied even without a * mark.

```
:5*A
should be
:5A
:5*cos(N*θ
should be
:5cos(Nθ
```

There are a few cases in which omitting the multiplication sign doesn't work. For example, 2^4*E3 (which evaluates to 16000) can't be replaced by 2^4E3, since the latter is interpreted as 2^(4000).

# Optimization

The * sign has the same truth value as the and operator because they both return zero if one or more of the numbers is zero (based on Boolean logic). Consequently, you sometimes see people implicitly multiplying expressions together in conditionals and loops, instead of joining them together with and. Unfortunately, this is not only usually larger in size, but often times slower.

```
:If (A=2)(B=7
should be
:If A=2 and B=7
```

It does save some space when you can avoid using parentheses:

```
:If A and B
could be
:If AB
```

# Timing

The amount of time taken to multiply two real floating-point numbers varies with the sum of the digits (including in the fractional part) of the right argument. On a 15 MHz calculator, a single multiplication in the worst case (when the right argument is 99999999999999) takes 3.3 ms, the best case (when the right argument is 0) takes about 0.1 ms, and the average case (for fourteen-digit floating point numbers) takes about 1.7 ms.

These timings do not include parser overhead or variable recall time, which are often significant in overall program speed.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/multiply

The * Command

Returns the multiplication of two numbers.

value1 * value2

**Menu Location**

Press the [*] key to paste *.

This command works on all calculators.

1 byte

The * operator multiplies two numbers, variables, or expressions. In many cases, it's implied — 5x, for instance, will be assumed to be 5*x. There are two exceptions: long variable names — xy will be interpreted as a single variable, not as x*y — and function calls — f(x) will be interpreted as f() applied to x, not as f*x.

Multiplication has higher priority than + and -, so it will be done before them; it has the same priority as /.

```
:x*y
x*y
:2*2
4
```

# Advanced Uses

Multiplying matrices is not the same as multiplying their individual elements (which the .* operator does). To multiply two matrices, the first must have the same number of columns as the second has rows. The product of an MxN matrix with an NxP matrix will be an MxP matrix, whose (a,b)^{th} entry will be the dot product of the a^{th} row of the first matrix with the b^{th} column of the second.

# Error Conditions

**240 - Dimension mismatch** happens when the dimensions of two matrices don't match up for multiplication to work.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:multiply

The & Command

Joins two strings together.

*string*&*string*

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press D to enter the String submenu.
- Press 4 to select &.

This command works on all calculators.

2 bytes

The & operator joins two strings together, one after the other, returning one large string.

```
:"Hello"&"World"
"HelloWorld"
:5→n
:"The value of n is "&string(n)
"The value of n is 5"
```

Appending strings is very useful when you want to display text. If you want to display more than one string on the same line, for instance with the Text command, you'll need to use & to combine the strings.

By default, & doesn't put in any separation between the strings, which can look weird: you can see this in the above example, where joining "Hello" and "World" made "HelloWorld". With multiple uses of &, you can put in any separator you like:

```
:"Hello"&" "&"World"
"Hello World"
```

If you want to use & to build up a string from scratch, start with "" — the empty string.

# Related Commands

- # (indirection)
- string()
- mid()

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:append

The # Command

Gets a variable given its name as a string.

#*var-name*

**Menu Location**

On a widescreen calculator, press 2nd # to paste #.

Or, on any calculator model, press:

- 2nd CHAR to enter the CHAR popup menu.
- 3 to enter the Punctuation submenu.
- 3 again to paste #.

This command works on all calculators.

2 bytes

The # operator takes a string containing a variable name, such as "x", and gives you the variable itself. This can be used to get the value of that variable (kind of like a weaker version of expr()), but the # operator really shines when you need to refer to the variable itself: storing to it, for example. 5→expr("var") will give you an error. 5→#"var", however, will work.

```
:"x"→str
:5→#str
5
:x
5
:DelVar #str
:x
x
```

You'll see # called the "indirection" operator (for instance, in the command catalog). This is because using # is an indirect way of accessing a variable's value: you don't have the variable itself to work with, just its name.

# Advanced Uses

The # command is particularly useful for dealing with picture variables, if you don't know the exact name of the picture ahead of time. For example, you might have two pictures, called 'cat' and 'dog', that you need to display depending on whether x=1 or x=2. This can be done with an If command, but that gets more and more complicated as you add pictures. On the other hand, you can always do this:

```
:{"cat","dog"}→pics
:RclPic #(pics[x])
```

The # command is necessary here because RclPic and commands like it want the actual picture variable as an argument, not a string with its name; expr() wouldn't work either because it would try to find the value of 'cat', and get an error.

Whenever you're dealing with external files created by someone else (such as external levels for a game), you don't know the variable names ahead of time, so you'll need the # operator. For the example of an external level, you would first input the variable name of the level into a string variable (say, the variable 'level'). Then you can use '#level', just as you would a regular variable, to refer to it.

# Optimization

In many cases, both # and expr() will do the same thing. In these cases, it's still better to use #, because it's faster.

# Error Conditions

**360 - Indirection string is not a valid variable name** happens when the string used with # isn't allowed as a variable name (e.g. longer than 8 characters).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:indirection

The % Command

Short for dividing by 100.

*value*%

This command can only be accessed through a hex editor (its hex code is 0xBB 0xDA)

TI-83/84+/SE, OS v1.15+

2 bytes

The % symbol is an undocumented command on the TI-83 series calculators starting with OS version 1.15. It's useful as a shortcut for percents - it divides by 100, so it will convert numbers to percentages. For example, 50% will become 50/100 or 1/2, which is just what 50% should be.

Although this trick can save you a few bytes, it also makes your program incompatible with old OS versions — it's up to you to decide if the tradeoff is worth it.

# Error Conditions

**ERR:INVALID**is thrown on older operating system versions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/percent

The % Command

Divides a number by 100.

*number*%

**Menu Location**

- Press 2nd CHAR to enter the CHAR menu.
- Press 3 to enter the Punctuation submenu.
- Press 5 to select %.

This command works on all calculators.

1 byte

The % operator is a cheap shortcut for dividing a number by 100: for instance, 25% = 25/100 = 1/4. When used on a list or matrix, it divides every element by 100.

It's somewhat higher in priority than regular division, so you don't need parentheses as often with it: for instance, 4^50% is equal to 4^(1/2)=2, not to (4^50)%.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:percent

The + Command

Returns the sum of two numbers, or joins two strings together.

*value1* + *value2*

*string1* + *string2*

Press [+]

TI-83/84/+/SE

1 byte

The + (add) operator takes two numbers, variables, or expressions and adds their values together, thus returning a single new value. The + operator appears lower in the order of operations than both * and /, so if those appear in an expression, they will be executed first. In addition, the - operator has the same order of operations as +, so the calculator simply executes them left to right in the order that they appear.

```
:1+1
2
:5→X
:2+3X
17
:2→A:3→B
:A/B+B/A
2.166666667
```

# Advanced Uses

The + operator is overloaded (meaning it has more than one function) by the calculator, and it can be used to put strings together. The strings can consist of whatever combination of text and characters that you want, but it unfortunately does not allow you to join a string to a number (i.e., "Hello5" cannot be made with "Hello"+5).

```
:"HELLO"+"WORLD
"HELLOWORLD
:"TI"+"-"+"BASIC
"TI-BASIC
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/add

The + Command

Returns the sum of two numbers.

*value1* + *value2*

**Menu Location**

Press the [+] key to paste +.

This command works on all calculators.

1 byte

The + operator adds two numbers, variables, or expressions together. Order of operations dictates that it's calculated after * and /, and at the same time as -.

The + operator can also be used on lists and matrices. For the most part, it behaves in the intuitive way, distributing the operation over each element. However, adding a number to a matrix (in either order) behaves differently: the number is only added along the main diagonal of the matrix. For "normal" addition that applies to every element of the matrix, see .+.

```
:1+1
2
:5→x
:2+3*x
17
:[1,2;3,4]+100
[101 2]
[3 104]
```

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:add

The → Command

The → (store) command will store a number, variable, or expression to a variable, using the respective value(s) of the variable(s) at the time. When storing a value in a variable, you have the value on the left side of → and the variable that it will be stored to on the right side.

```
:1→X
1
:{1.3,5.7,9.11→ABC
{1.3 5.7 9.11}
:"HELLO WORLD→Str1
"HELLO WORLD"
```

# Advanced

It's not easy to put a → symbol into a string, since "→→Str1 would produce a syntax error (and in general, when the calculator 'sees' a → symbol, it assumes that the string is over, and interprets the symbol literally).

However, you can use Equ►String( (outside a program) to get the → or " symbols in a string:

- Type them on the home screen and press [ENTER]
- Select 1:Quit when the
**ERR:SYNTAX**comes up. - Press [Y=] to go to the equation editor.
- Press [2nd] [ENTRY] to recall the symbols to Y
_{1} - Now, use Equ►String(Y
_{1},Str1) to store the symbols to a string.

# Optimization

You can remove closing parentheses, braces, brackets, and quotes that are before a → command.

```
:"Hello"→Str1
can be
:"Hello→Str1
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/store

The → Command

Stores a value to a variable.

*value*→*variable*

**Menu Location**

Press the STO> key to insert →.

This command works on all calculators.

1 byte

The `→` operator assigns a value to a variable.

Initially, a variable such as 'x', 'lastname', or 'cube' is undefined. When used in an expression, they will be treated as unknowns: 3*x-x may be simplified to 2*x, but will otherwise be left alone.

Once a value is assigned to a variable, that value will be substituted for the variable every time you use it. For example, you might store 5→x. Now, if you write 3*x-x, the answer won't be 2*x, but 10.

Any kind of value — a simple number, an expression, a string, list, or matrix, or even a function can be stored to a variable with →. The following are all valid:

```
:5→x
5
:"Alighieri"→lastname
"Alighieri"
:n^3→cube(n)
Done
```

As a special case, you can even store to a single element of a list or matrix. For example:

```
:{1,2,3,4,5}→list
{1 2 3 4 5}
:99→list[3]
99
:list
{1 2 99 4 5}
```

# Advanced Uses

Using the # (`indirection`) operator, you can store a value to a variable given its name, in a string.

# Optimization

There are alternatives to `→` such as `Define` or `CopyVar`; they have their uses in special situations, but `→` is better (smaller and easier to understand) in other cases.

# Error Conditions

**190 - Circular definition** happens when an undefined variable is given a value in terms of itself (e.g. x+1→x).

# Related Commands

- # (
`indirection`) `Define``DelVar`

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:store

The ‾ Command

The ‾ (negative) operator takes one number, variable, or expression and negates its value, thus returning the negative equivalent of it. The ‾ operator appears higher in the order of operations than both the relational and logical operators, so it will be executed first. In addition, it has the same order of operation as the other math operators, so the calculator simply executes them left to right in the order that they appear.

```
:‾1
-1
:5→X
:‾3(X+2
-21
:‾2→A:‾3→B
:AB
6
```

# Optimization

When adding a negative number to a positive number, switch the two numbers around and change the addition to subtraction. This allows you to get rid of the ‾ sign and save a byte.

```
:‾A+B→C
can be
:B-A→C
```

This is not always the case, however: if you subtract a command that uses a lot of parentheses and is followed by a newline/colon/STO→ arrow, it'd save space to put the subtraction at the beginning of the line. For instance:

```
:inString(Ans,sub(Str1,1,1+int(log(A))))-1
can be
:‾1+inString(Ans,sub(Str1,1,1+int(log(A
```

# Error Conditions

If an **ERR:SYNTAX** is being thrown near a subtraction or negation where there should be no errors, check to make sure that ‾ (negation) and - (subtraction) were not swapped by mistake.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/negative

The ‾ Command

Negates an expression.

‾*expression*

**Menu Location**

Press the ‾ key to enter ‾.

This command works on all calculators.

1 byte

The ‾ operator gives the negative of the value immediately following it. It's not to be confused with the - operator, which subtracts two numbers — while on paper you'd generally use the same symbol for -2 and 4-2, the calculator has two different symbols, and negation is represented by the slightly shorter and higher dash.

You can also use ‾ to negate lists and matrices, which will negate each element, as expected.

```
:1+‾1
0
:‾(x-1)
‾x+1
:‾[1,2;3,4]
[‾1 ‾2]
[‾3 ‾4]
```

Other pages on this site will use - to mean both subtraction and negation, where it isn't confusing.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:negative

The ∟ Command

Indicates the beginning of a custom list.

∟*LISTNAME*

While editing a program, press:

- 2nd LIST to access the List menu
- RIGHT to access the OPS submenu
- 2nd B to select ∟, or use arrows

TI-83/84/+/SE

1 byte

The ∟ command indicates the beginning of a custom list (i.e., any list the user creates, not including the default lists L_{1}…L_{6}). You almost always need to include this when accessing or manipulating a custom list. The maximum length of the list name (not including the ∟) is five letters. ∟ABCDE works, but ∟ABCDEF does not.

# Optimization

You don't need to include the ∟ command when storing (→) to a list. Some of the list commands also allow for this optimization, such as SetUpEditor. However, it can create problems when using Input and Prompt because you might only be asking the user to input a list, but a real variable would also be allowed.

# Error Conditions

**ERR:UNDEFINED**is thrown if you try to use ∟ on an undefined list.

# Related Commands

- → (store)

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/l

The ∠ Command

Used in entering a vector in polar, cylindrical, or spherical format, or a complex number in polar form.

[*r*,∠*θ*]

[*r*,∠*θ*,*z*]

[*r*,∠*θ*,∠*φ*]

(*r*∠*θ*)

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press 2 to enter the Angle submenu.
- Press 7 to select ∠.

This command works on all calculators.

1 byte

The ∠ operator is used for alternate forms of entering vectors or complex numbers. It will be used for output depending on the Complex Format and Vector Format mode settings, but you can always use it in an expression.

For vectors (which are just 1x2 or 1x3 matrices, as far as ∠ is concerned):

- [r,∠θ] is equivalent to [r*cos(θ),r*sin(θ)]
- [r,∠θ,z] is equivalent to [r*cos(θ),r*sin(θ),z]
- [r,∠θ,∠φ] is equivalent to [r*cos(θ)*sin(φ),r*sin(θ)*sin(φ),r*cos(φ)]

These have to be row vectors — you can't use column vectors with ∠.

For complex numbers, (r∠θ) is equivalent to r*(cos(θ)+* i**sin(θ)). You have to have the parentheses there, and both r and θ must be real numbers or expressions.

# Error Conditions

**260 - Domain error** happens when complex numbers are used in the vector notation.

**580 - Invalid polar complex** happens when the values of r and θ in the complex number notation are invalid.

**640 - Invalid vector syntax** happens when the ∠ mark is misplaced in the vector notation.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:angle-symbol

The ▶ Command

Converts an expression from one unit to another.

*expression*▶*units*

**Menu Location**

Press [2nd][▶] to enter ▶: this is

- [2nd][MODE] on a TI-89 or TI-89 Titanium
- [2nd][Y] on a TI-92, TI-92 Plus, or Voyage 200

This command works on all calculators.

2 bytes

The ▶ operator converts an expression to a different unit. Usually, this refers to the built-in units (such as _m (meters), _mph (miles per hour, etc.) which you can select from the UNITS menu.

To use it, you must first have the expression on the left in terms of some unit — this is done by multiplying it by that unit. For instance, "5 meters" is written as 5_m or 5*_m (where _m is the unit). You can combine units as well: for instance, 5_m^2 (5 square meters) or 30_km/_hr (30 kilometers per hour).

To convert that into a different unit, type ▶ and then a different unit to convert to (again, you can combine units). For instance, to convert 5 square meters to acres, type 5_m^2▶_acre. (Note: the result will always be expressed as a decimal)

```
:30_km/_hr▶_m/_s
8.33333*_m/_s
:5_N▶_dyne
500000.*_dyne
```

You can't use ▶ to convert between units of temperature (degrees Celsius to degrees Fahrenheit, for instance), since the calculator isn't sure if you mean absolute temperature or a change in temperature instead. Use the tmpCnv() and ΔtmpCnv() commands instead.

# Advanced Uses

It's possible to define your own units as well: units are just any variable beginning with an underscore, and ▶ will perform just as well converting between those. There are two ways to go about it. The first is to define your units in terms of existing ones: for instance, you might define a furlong (one-eighth of a mile) as follows:

```
:1/8_mi→_furlong
1/8*_mi
:110_yd▶_furlong
.5*_furlong
```

The second method is to start with a unit or several units to keep undefined (for instance, _x). You can then define other units in terms of _x, and convert between them:

```
:5_x→_y
5*_x
:3_y▶_x
15.*_x
:10_x/_s▶_y/_s
2.*_y/_s
```

Units are treated just like variables, except that they're universal across folders: you can have only one instance of _x, and you can access it as _x no matter which folder you're in. You can use this if you want to define a universal variable to access in any folder: for instance, if you define a program as _prgm(), you can run it with _prgm() from any folder.

# Error Conditions

**345 - Inconsistent units** happens when converting between two units that measure different types of quantities (for instance, converting length to time).

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:convert

The √( Command

Take the square root of a number.

√(*input*)

Press 2nd √ to paste the √( command.

TI-83/84/+/SE

1 byte

Takes the square root of a positive or negative number. It works exactly the same as 2^{×}√ or ^(1/2) but is smaller and uses an ending parenthesis. If used on a list, it will return a list with the square root of each element.

```
√(4)
2
√(2)
1.414213562
√({1,-1})
{1 i}
```

This may return a complex number or throw ERR:NONREAL ANS (depending on mode settings) if taking the square root of a negative number.

# Optimization

Never raise something to the one-half power explicitly; use this command instead.

```
:X^(1/2)→X
can be
:√(X→X
```

# Error Conditions

**ERR:NONREAL ANS**when taking the square root of a negative number in Real mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/square-root

The ∏() Command

Multiplies together the evaluations of an expression with one variable taking on a range of values.

∏(*expression*, *variable*, *start*, *end*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press B to enter the Calculus submenu.
- Press 5 to select ∏(.

This command works on all calculators.

2 bytes

∏() is used to multiply a sequence of numbers. ∏(*expression*, *variable*, *start*, *end*) will evaluate *expression* for *variable*=*start*, then for *variable*=*start*+1, all the way through *variable*=*end*, and multiply the results:

```
:∏(f(x),x,1,5)
f(1)*f(2)*f(3)*f(4)*f(5)
:∏(x,x,1,5)
120
```

In this way, ∏() is no different from taking product() of a sequence generated by seq(). However, ∏() can be used for more abstract calculations — for instance, when *start* or *end* is an undefined variable, it will try to find the product in terms of that variable. ∏() can also be used to find the product of an infinite series (just make the value of *end* infinity — ∞).

```
:∏(x,x,1,n)
n!
:∏(1-1/x,x,2,n)
1/n
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:product-pi

The ∑() Command

Adds together the evaluations of an expression with one variable taking on a range of values.

∑(*expression*, *variable*, *start*, *end*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press B to enter the Calculus submenu.
- Press 4 to select ∑(.

This command works on all calculators.

2 bytes

∑() is used to add a sequence of numbers. ∑(*expression*, *variable*, *start*, *end*) will evaluate *expression* for *variable*=*start*, then for *variable*=*start*+1, all the way through *variable*=*end*, and add up the results:

```
:∑(f(x),x,1,5)
f(1)+f(2)+f(3)+f(4)+f(5)
:∑(x^2,x,1,5)
55
```

In this way, ∑() is no different from taking sum() of a sequence generated by seq(). However, ∑() can be used for more abstract calculations — for instance, when *start* or *end* is an undefined variable, it will try to find the sum in terms of that variable. ∑() can also be used to sum an infinite series (just make the value of *end* infinity — ∞).

```
:∑(x^2,x,1,n)
n*(n+1)*(2*n+1)/6
:∑(2^-x,x,1,∞)
1
```

# Optimization

It's a good idea to replace sum(seq( by ∑( whenever it occurs. The only difficulty arises if seq() uses its *step* argument, since ∑() doesn't have one. There are three options:

- Forget about using ∑() and just go with the sum(seq( alternative.
- Use a when() expression (probably with mod()) to select the entries you care about.
- Use a linear equation to transform values from 1 to N into the correct values with the step.

Here is an example of these approaches:

`:sum(seq(x^2,x,1,9,2))`

This calculates 1

^{2}+3

^{2}+5

^{2}+7

^{2}+9

^{2}.

`:∑(when(mod(x,2)=1,x^2,0),x,1,9)`

The when() command selects only the odd numbers — those with mod(x,2)=1 — from 1 to 9.

`:∑((2x-1)^2,x,1,5)`

The equation 2*x-1 transforms the numbers 1..5 into the odd numbers 1..9.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:sum-sigma

The √() Command

Takes the square root of a number.

√(*number*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

1 byte

The √() command takes the square root of a value: √(x) is a number that, when multiplied by itself, gives x. It's a special case of the ^ and root() commands: √(x) = x^(1/2) = root(x,2).

Unless the calculator is in approximate mode, or you force it to approximate (by pressing ♦+ENTER, or using approx()), it won't try to evaluate all square roots: it will take the square root of perfect squares, otherwise, it will just take out all the square factors (for instance, √(20) is simplified to 2√(5)).

For positive numbers, √() will return the positive square root; more generally, if the result is complex (and if the calculator is in complex number mode), the result of √() will be the one with non-negative real part.

```
:√(16)
4
:√(-12)
2*√(3)*i
```

If the square root of a list is taken, it will take the square root of every element of the list.

# Advanced Uses

The √() of a matrix is not (in general) the same as taking the square root of every element of the matrix. A different definition is used to compute the result; see Matrices and Their Commands. It requires the matrix to be square and diagonalizable in order to apply.

# Error Conditions

**230 - Dimension** happens when taking the square root of a non-square matrix.

**665 - Matrix not diagonalizable** happens when diagonalization (used to take square roots of matrices) fails.

**800 - Non-real result** happens when taking the square root of a negative or complex number, in real number mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:square-root

The ∫() Command

Takes the integral of an expression.

∫(*expression*,*variable*)

∫(*expression*,*variable*,*constant*)

∫(*expression*,*variable*,*lower*,*upper*)

**Menu Location**

Press [2nd][7] to enter ∫(.

This command works on all calculators.

2 bytes

∫(*expression*,*variable*) takes the integral of *expression* (symbolically) with respect to *variable*. All other variables are treated as constant.

There are three ways to use ∫(). The syntax above returns an indefinite integral. ∫(*expression*,*variable*,*c*) does the same, but with a constant of integration, *c* (this will just get added on to the result). Finally, ∫(*expression*,*variable*,*a*,*b*) takes a definite integral from *a* to *b*. These limits can be anything, including undefined variables, ∞ and -∞, as long as they don't depend on *variable*.

```
:∫(x^2,x)
x^3/3
:∫(x^2,x,c)
x^3/3+c
:∫(x^2,x,a,b)
b^3/3-a^3/3
```

Indefinite integrals are always computed exactly or not at all: if a part of the expression (or the entire expression) can't be integrated, the result will stay in terms of ∫(). However, definite integrals will sometimes be approximated, depending on the Exact/Approx mode setting:

- If EXACT, integrals will never be approximated.
- If AUTO, the calculator will approximate integrals like ∫(
*e*^(-x^2),x,-1,1) that it can't compute exactly. - If APPROX, all definite integrals will be done numerically if possible.

```
:∫(e^(-x^2),x)
∫(e^(-x^2),x)
:∫(e^(-x^2),x,-1,1)
2*∫(e^(-x^2),x,0,1) (in EXACT mode)
1.49365 (in AUTO or APPROX mode)
```

Finally, you can take multiple integrals by applying ∫() to the result of another ∫() (any number of times). The integration limits of the inner integrals can involve the variables of the outer integrals.

```
:∫(∫(x*y,x),y)
y^2*x^2/4
:∫(∫(x*y,x,0,y),y,0,1)
1/8
```

If the expression is a list or matrix, ∫() takes the integral of each element.

# Error Conditions

**140 - Argument must be a variable name** happens when the variable of integration isn't a variable.

**220 - Dependent limit** happens when the integration limits depend on the variable of integration.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:integral

The ° (Degree Symbol) Command

If the calculator is in radian mode, the ° (degree) symbol converts an angle to radians.

*angle*°

Press:

- [2nd]
- [Angle]
- [Enter] or [1]

TI-83/84/+/SE

1 byte

Normally, when the calculator is in radian mode, the trigonometric functions only return values calculated in radians. With the ° symbol you can have the angle evaluated as if in degree mode because it converts the angle into radians.

One full rotation around a circle is 2π radians, which is equal to 360°. To convert an angle in radians to degrees you multiply by 180/π, and to convert from degrees to radians multiply by π/180.

In radian mode:

```
sin(45) \\ actually calculating sin(2578.31)
.8509035245
sin(45°)
.7071067812
```

In degree mode:

```
sin(45)
.7071067812
sin(45°)
.7071067812 \\ There's no difference when in degrees
```

# Optimization

When you only call the trig function once in a program and want it calculated in degrees, instead of changing the mode you can just use ° to save one-byte (the newline from using the command Degree)

```
:Degree
:sin(X)
can be
:sin(X°)
```

# Related Commands

^{r}(radian symbol)

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/degree-symbol

The 0b Command

Indicates that a number is written in binary.

0b*digits*

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The calculator can work with numbers written in three bases: decimal (the usual), binary, and hexadecimal. The 0b command indicates that a number is written in binary:

```
:0b101
5
:0b100000
32
```

When written in binary, numbers are expressed as signed 32-bit integers, which means that only the integers between -2^{31} and 2^{31}-1 can be expressed in binary. With other binary-related commands, numbers are simply truncated to fit in this range. Not so with 0b: if you enter more than 32 binary digits after the 0b, the result is a domain error.

Even if the calculator is in binary mode, you still have to write 0b for an integer to be interpreted as binary: binary mode only affects output. If the calculator is in decimal mode, which is the default, you have to use ▶Bin to get output in binary.

# Error Conditions

**260 - Domain error** happens when 0b is used with more than 32 binary digits after it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:0b

The 0h Command

Indicates that a number is written in hexadecimal.

0h*digits*

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The calculator can work with numbers written in three bases: decimal (the usual), binary, and hexadecimal. The 0h command indicates that a number is written in hexadecimal:

```
:0h10
16
:0h2F6
758
```

When written in hexadecimal, numbers are expressed as signed 32-bit integers (32 bits correspond to 8 hexadecimal digits), which means that only the integers between -2^{31} and 2^{31}-1 can be expressed in hexadecimal. With other hexadecimal-related commands, numbers are simply truncated to fit in this range. Not so with 0h: if you enter more than 8 hexadecimal digits after the 0b, the result is a domain error.

Even if the calculator is in hexadecimal mode, you still have to write 0h for an integer to be interpreted as hexadecimal: the mode setting only affects output. If the calculator is in decimal mode, which is the default, you have to use ▶Hex to get output in hexadecimal.

# Error Conditions

**260 - Domain error** happens when 0h is used with more than 8 hexadecimal digits after it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:0h

The 10^( Command

**Command Summary**

Raises 10 to a power.

**Command Syntax**

10^(*value*)

**Menu Location**

Press [2nd] [10^{x}] to paste 10^(.

**Calculator Compatibility**

TI-83/84/+/SE

**Token Size**

The `10^(` command raises 10 to a power. Since it's possible to just type out 1, 0, ^, and (, the reason for having a separate function isn't immediately obvious, but the command is occasionally useful.

`10^(` accepts numbers and lists as arguments. It also works for complex numbers.

```
10^(2)
100
10^({-1,0,1})
{0.1 1 10}
```

# Optimization

Don't type `10^(` out, use this command instead. It's three bytes smaller and usually faster as well. However, keep in mind that you might be able to use the `E` command instead of `10^(`, for constant values.

# Command Timings

The command `10^(` is faster than typing out `10^(` in most cases, except for small integer arguments. Even faster is `E`, but that only works for raising 10 to a constant power.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/ten-exponent

The ֿ¹ Command

Returns the reciprocal of a number (1 divided by the number). For matrices, finds the matrix inverse.

*value*ֿ¹

Press [*x*ֿ¹]

TI-83/84/+/SE

1 byte

The ֿ¹ command returns the reciprocal of a number, equivalent to dividing 1 by the number (although reciprocals are sometimes more convenient to type). It also works for lists, by calculating the reciprocal of each element.

The ֿ¹ command can also be used on matrices, but it is the matrix inverse that is computed, not the reciprocal of each element. If [A] is an N by N (square) matrix, then [A]ֿ¹ is the N by N matrix such that [A][A]ֿ¹=[A]ֿ¹[A] is the identity matrix. ֿ¹ does not work on non-square matrices.

```
4ֿ¹
.25
{1,2,3}ֿ¹
{1 .5 .3333333333}
[[3,2][4,3]]ֿ¹
[[3 -2]
[-4 3 ]]
```

Much like the number 0 does not have a reciprocal, some square matrices do not have inverses (they are called singular matrices) and you'll get an error when you try to invert them.

# Optimization

Writing Aֿ¹B instead of B/A is sometimes beneficial when B is a complicated expression, because it allows you to take off closing parentheses of B. For example:

```
:(P+√(P²-4Q))/2
can be
:2ֿ¹(P+√(P²-4Q
```

This may be slower than dividing. There are also situations in which this optimization might lose precision, especially when the number being divided is large:

```
7fPart(4292/7
1
7fPart(7ֿ¹4292
.9999999999
```

# Error Conditions

**ERR:DIVIDE BY 0**is thrown when trying to take the reciprocal of 0.**ERR:SINGULAR MAT**is thrown when trying to invert a singular matrix.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/inverse

The 1-PropZInt( Command

Computes a Z confidence interval of a proportion.

1-PropZInt(*x*, *n*[, *confidence level*])

When editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- ALPHA A to select 1-PropZInt(, or use arrows

(this key sequence will give you the 1-PropZInt… screen outside a program)

TI-83/84/+/SE

2 bytes

The 1-PropZInt( command calculates a confidence interval for a proportion, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the proportion lies within the interval you get. The command assumes that the sample is large enough that the normal approximation to binomial distributions is valid: this is true if, in the sample you take, the positive and negative counts are both >5.

The 1-PropZInt( command takes 3 arguments. The first, *x*, is the positive count in the sample. The second, *n*, is the total size of the sample. (So the sample proportion is equal to *x* out of *n*). The third argument is the confidence level, which defaults to 95.

The output gives you a confidence interval of the form (a,b), meaning that the true proportion π is most likely in the range a<π<b, and the value of *x**/n*.

# Sample Problem

You want to know the proportion of students at your school that support a particular political candidate. You take a random sample of 50 students, and find that 22 of them support that candidate. 22, the positive count, and 50-22=28, the negative count, are both >5, so the assumption is satisfied.

Using 22 for *x*, and 50 for *n*, you decide to find a 95% confidence interval. The syntax for that is:

```
:1-PropZInt(22,50,95
which can also be
:1-PropZInt(22,50,.95
```

The output if you run the above code will look approximately like this:

```
1-PropZInt
(.30241,.57759)
p=.44
n=50
```

This tells you that between about 30.2% and about 57.8% of the students at your school are in support of the political candidate.

# Optimization

If the confidence level is 95%, you can omit the final 95, since that is the default value:

```
:1-PropZInt(22,50,95
can be
:1-PropZInt(22,50
```

# Error Conditions

**ERR:DOMAIN**is thrown if the sample proportion is not between 0 and 1, any argument is negative, or the confidence level is 100 or more.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/1-propzint

The 1-PropZTest( Command

Performs a *z*-test on a proportion.

1-PropZTest(*p _{0}*,

*x*,

*n*[,

*alternative*,

*draw?*] )

While editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- 5 to select 1-PropZTest, or use arrows

(outside the program editor, this will select the 1-PropZTest… interactive solver)

TI-83/84/+/SE

2 bytes

1-PropZTest performs an *z*-test to compare a population proportion to a hypothesis value. This test is valid for sufficiently large samples: only when the number of successes (*x* in the command syntax) and the number of failures (*n*-*x*) are both >5.

The logic behind the test is as follows: we want to test the hypothesis that the true proportion is equal to some value *p _{0}* (the null hypothesis). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the (usually, somewhat different) actual proportion occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the true proportion is not equal to

*p*. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it.

_{0}Commonly used notation has the letter π being used for the true population proportion (making the null hypothesis be π=p_{0}). TI must have been afraid that this would be confused with the real number π, so on the calculator, "prop" is used everywhere instead.

In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the proportion is not equal to *p _{0}*. However, in certain cases, our alternative hypothesis may be that the proportion is greater or less than

*p*.

_{0}The arguments to 1-PropZTest( are as follows:

*p*- the value for the null hypothesis (the proportion you're testing for)_{0}*x*- the success count in the sample*n*- the total size of the sample (so the sample proportion would be*x**/n*)*alternative*(optional if you don't include*draw?*) - determines the alternative hypothesis- 0 (default value) - prop≠p
_{0} - -1 (or any negative value) - prop<p
_{0} - 1 (or any positive value) - prop>p
_{0}

- 0 (default value) - prop≠p
*draw?*(optional) set this to 1 if you want a graphical rather than numeric result

Although you can access the 1-PropZTest command on the home screen, via the catalog, there's no need: the 1-PropZTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax.

In either case, it's important to understand the output of 1-PropZTest. Here are the meanings of each line:

- The first line, involving "prop" and
*p*, is the alternative hypothesis._{0} - z is the test statistic. If the null hypothesis is true, it should be close to 0.
- p is the probability that the difference between the proportion and
*p*would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms._{0} - p-hat is the sample proportion,
*x**/n*. - n is the sample size.

# Advanced Uses

The final optional argument of 1-PropZTest, *draw?*, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of z and the value of p will be displayed. You would make your conclusions in the same way as for the regular output.

# Optimization

Some of the arguments of the 1-PropZTest command have default values, and the argument can be omitted if this value is used.

- The
*draw?*argument can be omitted if you don't want graphical output, although you could put "0" in as well. - If the above argument is omitted, and you're doing a two sided test, you may omit the
*alternative*argument.

Example:

```
:1-PropZTest(.5,22,50,0,0
can be
:1-PropZTest(.5,22,50
```

# Error Conditions

**ERR:DOMAIN**is thrown if*p*or_{0}*x**/n*are not between 0 and 1, or*x*is negative or greater than*n*(however, any real value for*alternative*and*draw?*will work)

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/1-propztest

The 1-Var Stats Command

Calculates some statistics for a single list of data, and stores them to statistical variables. They're also displayed in a scrollable list, if done outside a program.

1-Var Stats [*list*, [*freqlist*]]

Press:

- STAT to access the statistics menu
- LEFT to access the CALC submenu
- 1 or ENTER to select 1-Var Stats

TI-83/84/+/SE

1 byte

This command calculates a bunch of common (and a few uncommon) statistics for a list (it uses L1 by default, but you can use any list by supplying it as an argument). You have to store the list to a variable first, though, before calculating statistics for it. For example:

```
:{5,12,7,8,4,9→L1
:1-Var Stats
```

Like other statistical commands, you can use a frequency list as well, for cases where one element occurs more times than another (you can do this with a normal list, too, but that might be inconvenient when an element occurs very many times). For example:

```
:{1,2,3→L1
:{5,3,2→L2
:1-Var Stats L1,L2
```

is the frequency-list equivalent of:

```
:{1,1,1,1,1,2,2,2,3,3→L1
:1-Var Stats
```

When you're running it from the home screen, 1-Var Stats will display the statistics; this won't happen if you do it inside a program. Either way, it will also store what it calculated to the statistics variables found in VARS>Statistics… The variables 1-Var Stats affects are:

- $\overline{\textrm{x}}$ is the mean (average) of the elements, as returned by mean(
- Σx is the sum of the elements, as returned by sum(
- Σx² is the sum of the squares of the elements
- Sx is the sample standard deviation, as returned by stdDev(
- σx is population standard deviation
- n is the number of elements in the list, as returned by dim(
- minX is the minimum value, as returned by min(
- Q1 is the first quartile
- Med is the median, as returned by median(
- Q3 is the third quartile
- maxX is the maximum value, as returned by max(

1-Var Stats will not work with "reserved" list names that the calculator uses internally. The only known such reserved list is the list RESID, and there's no reason to suspect there are any others. Ans, TblInput, and any expression which resolves to a list, are also not appropriate for this command: store all of these to a list before doing 1-Var Stats on them.

# Optimization

Aside from statistical analysis, 1-Var Stats can also be used when you want to use the values it calculates more than once. This will save on size, since, for example Σx takes up less space than sum(L1), but considering how many calculations 1-Var Stats makes, it will usually be slower. Here's a short example which saves 1 byte:

```
:Disp "RANGE:",max(L1)-min(L1
can be
:1-Var Stats
:Disp "RANGE:",maxX-minX
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/1-var-stats

The ² Command

The ² command raises an input to the second power. It has exactly the same function as "^2", but is one byte smaller. If used on a list, it will return a list with all of the elements squared. If used on a matrix, it will return the second matrix power of the input matrix.

```
2²
4
{1,‾2,3}²
{1 4 9}
[[2,‾1][‾3,0]]²
[[1 ‾2]
[6 ‾3]]
```

# Optimization

Use this command instead of ^2 in all instances.

```
:X^2
can be
:X²
```

# Related Commands

^{-1}^{3}

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2

The 2-PropZInt( Command

Computes a Z confidence interval of the difference between two proportions.

2-PropZInt(*x _{1}*,

*n*,

_{1}*x*,

_{2}*n*, level//

_{2}When editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- ALPHA B to select 2-PropZInt(, or use arrows

(this key sequence will give you the 2-PropZInt… screen outside a program)

TI-83/84/+/SE

2 bytes

The 2-PropZInt( command calculates a confidence interval for the difference between two proportions, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the difference lies within the interval you get. The command assumes that the sample is large enough that the normal approximation to binomial distributions is valid: this is true if, in both samples involved, the positive and negative counts are both >5.

The 1-PropZInt( command takes 5 arguments. The first two, *x _{1}* and

*n*are the positive count and total count in the first sample (so the estimated value of the first proportion is

_{1}*x*out of

_{1}*n*. The next two arguments,

_{1}*x*and

_{2}*n*, are the positive count and total count in the second sample.

_{2}The output gives you a confidence interval of the form (a,b), which is the range of values for the difference π_{1}-π_{2} (where π_{1} and π_{2} are the first and second proportions respectively). If you were looking for the difference π_{2}-π_{1} all you have to do is switch two sides and negate the numbers in the interval.

# Sample Problem

You want to compare the proportion of students at your school and at a friend's school. that support a particular political candidate. You take a random sample of 50 students, and find that 22 of them support that candidate. Your friend took a random sample of 75 students at his school, and found that 28 supported the candidate.

The first proportion is the proportion of supporters at your school. 22 out of 50 students support the candidate, so *x _{1}*=22 and

*n*=50.

_{1}The second proportion is the proportion of supporters at your friend's school. 28 out of 75 students support the candidate, so

*x*=28 and

_{2}*n*=75.

_{2}If you decided to do a 95% confidence interval, you would add the argument 95 after all these, so the syntax would be as follows:

```
:2-PropZInt(22,50,28,75,95
which can also be
:2-PropZInt(22,50,28,75,.95
```

The output if you run the above code will look approximately like this:

```
1-PropZInt
(-.1092,.24249)
p1=.44
p2=.3733333333
n1=50
n2=75
```

This tells you that between about the difference betwen the proportions is between about -0.11 (your school's proportion being about 0.11 less than your friend's school's proportion) to about 0.24 (your school's proportion being about 0.24 greater than your friend's school's proportion).

# Optimization

If the confidence level is 95%, you can omit the final 95, since that is the default value:

```
:2-PropZInt(22,50,28,75,95
can be
:2-PropZInt(22,50,28,75
```

# Error Conditions

**ERR:DOMAIN**is thrown if either proportion is not between 0 and 1, or*x*is negative or greater than_{i}*n*, or the confidence level is negative or at least 100._{i}

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-propzint

The 2-PropZTest( Command

Performs a *z*-test to compare two proportions.

2-PropZTest(*x _{1}*,

*n*,

_{1}*x*,

_{2}*n*, //draw?//

_{2}While editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- 6 to select 2-PropZTest, or use arrows

(outside the program editor, this will select the 2-PropZTest… interactive solver)

TI-83/84/+/SE

2 bytes

2-PropZTest performs an *z*-test to compare two population proportions. This test is valid for sufficiently large samples: only when the number of successes (*x* in the command syntax) and the number of failures (*n*-*x*) are both >5, for both populations.

The logic behind the test is as follows: we want to test the hypothesis that the proportions are equal (the null hypothesis). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the differences between the two proportions occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the proportions are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it.

Commonly used notation has the letters π_{1} and π_{2} being used for the true population proportions (making the null hypothesis be π_{1}=π_{2}). TI must have been afraid that this would be confused with the real number π, so on the calculator, "p1" and "p2" are used everywhere instead.

In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the proportions are not equal. However, in certain cases, our alternative hypothesis may be that one proportion is greater or less than the other.

The arguments to 1-PropZTest( are as follows:

*x*- the success count in the first sample_{1}*n*- the total size of the first sample (so the sample proportion would be_{1}*x*_{1}*/n*)_{1}*x*- the success count in the second sample_{2}*n*- the total size of the second sample (so the sample proportion would be_{2}*x*_{2}*/n*)_{2}*alternative*(optional if you don't include*draw?*) - determines the alternative hypothesis- 0 (default value) - p1≠p2
- -1 (or any negative value) - p1<p2
- 1 (or any positive value) - p1>p2

*draw?*(optional) set this to 1 if you want a graphical rather than numeric result

Although you can access the 1-PropZTest command on the home screen, via the catalog, there's no need: the 1-PropZTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax.

In either case, it's important to understand the output of 1-PropZTest. Here are the meanings of each line:

- The first line, involving p1 and p2, is the alternative hypothesis.
- z is the test statistic. If the null hypothesis is true, it should be close to 0.
- p is the probability that the difference between the two proportions would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms.
- p-hat
_{1}is the sample proportion*x*_{1}*/n*._{1} - p-hat
_{2}is the sample proportion*x*_{2}*/n*._{2} - p-hat is the total sample proportion
- n
_{1}is the first sample size. - n
_{2}is the second sample size.

# Advanced Uses

The final optional argument of 2-PropZTest, *draw?*, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of z and the value of p will be displayed. You would make your conclusions in the same way as for the regular output.

# Optimization

Some of the arguments of the 2-PropZTest command have default values, and the argument can be omitted if this value is used.

- The
*draw?*argument can be omitted if you don't want graphical output, although you could put "0" in as well. - If the above argument is omitted, and you're doing a two sided test, you may omit the
*alternative*argument.

Example:

```
:2-PropZTest(22,50,48,100,0,0
can be
:2-PropZTest(22,50,48,100
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-propztest

The 2-SampFTest Command

Performs a *F*-test to compare the standard deviations of two populations.

2-SampFTest [*list1*, *list2*, *frequency1*, *frequency2*, *alternative*,*draw?*]

(data list input)

2-SampFTest *s _{1}*,

*n*,

_{1}*s*,

_{2}*n*, [

_{2}*alternative*,

*draw?*]

(summary stats input)

While editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- ALPHA D to select 2-SampFTest, or use arrows

Outside the program editor, this will select the 2-SampFTest… interactive solver.

Change the last keypress to ALPHA E on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE

2 bytes

2-SampFTest performs an *F*-test to compare the standard deviations of two populations. This test is valid for two normally distributed populations, but is extremely sensitive to non-normality, so it should not be used unless you are certain that the populations are normal.

The logic behind the test is as follows: we want to test the hypothesis that the standard deviations of the two populations are equal (the null hypothesis). The letter σ is used for a standard deviation, so this is usually written as σ_{1}=σ_{2}. To do this, we assume that this "null hypothesis" is true, and calculate the probability that the difference between the two standard deviations occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the deviations are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it.

In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the two standard deviations are not equal. However, in certain cases when we have reason to suspect that one deviation is greater than the other (such as when we are trying to verify a claim that one standard deviation is greater), our alternative hypothesis may be that the first standard deviation is greater than the second (σ_{1}>σ_{2}) or less (σ_{1}<σ_{2}).

As for the 2-SampFTest command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list (*s _{1}* and

*s*the sample standard deviations, and

_{2}*n*and

_{1}*n*the sample sizes). In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the

_{2}*alternative*argument. 0 indicates a two-sided hypothesis of

*σ*≠

_{1}*σ*, -1 indicates

_{2}*σ*<

_{1}*σ*, and 1 indicates

_{2}*μ*>

_{1}*μ*. (In fact, the calculator will treat any negative value as -1, and any positive value as 1).

_{2}Although you can access the 2-SampFTest command on the home screen, via the catalog, there's no need: the 2-SampFTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax.

In either case, it's important to understand the output of 2-SampFTest. Here are the meanings of each line:

- The first line, involving σ
_{1}and σ_{2}, is the alternative hypothesis. - F is the test statistic, the ratio of the standard deviations. If the null hypothesis is true, it should be close to 1.
- p is the probability that the difference between σ
_{1}and σ_{2}(the two standard deviations) would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. - Sx
_{1}and Sx_{2}are the two sample standard deviations. - x-bar
_{1}and x-bar_{2}are the two sample means. They aren't used in the calculation, and will only be shown with the data list syntax. - n
_{1}and n_{2}are the sample sizes.

# Advanced Uses

The final optional argument of 2-SampFTest, *draw?*, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of F and the value of p will be displayed. You would make your conclusions in the same way as for the regular output.

As with most other statistical commands, you may use frequency lists in your input (when using the data list syntax). If you do, then both lists must have frequencies, and the order of the arguments would be *list1*, *list2*, *frequency1*, *frequency2*.

# Optimization

Some of the arguments of the 2-SampFTest command have default values, and the argument can be omitted if this value is accepted.

- The
*draw?*argument can be omitted if you don't want graphical output, although you could put "0" in as well. - If the above argument is omitted, and you're doing a two sided test, you may omit the
*alternative*argument. - With data list input, you can always omit the frequency lists if you won't be using them.
- With data list input, if the flags that go at the end are omitted, and you're using the default lists L1 and L2, you may omit those as well.

Example:

```
:2-SampFTest L1,L2,0
can be
:2-SampFTest
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-sampftest

The 2-SampTInt Command

Using either already-calculated statistics, or two data sets, computes a T confidence interval for the difference between two sample means.

2-SampTInt *list1*, *list2*, [*frequency1*], [*frequency2*], [*confidence level*, *pooled*]

(data list input)

2-SampTInt *x _{1}*,

*s*,

_{1}*n*,

_{1}*x*,

_{2}*s*,

_{2}*n*, [

_{2}*confidence level*,

*pooled*]

(summary stats input)

When editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- 0 to select 2-SampTInt, or use arrows

(this key sequence will give you the 2-SampTInt… screen outside a program)

TI-83/84/+/SE

2 bytes

The 2-SampTInt command uses the techniques of T Intervals to compute an interval for the **difference** between the means of two independent populations, at a specified confidence level. Use 2-SampTInt( when you have two independent variables to compare, and you don't know their standard deviations. The 2-SampTInt command assumes that both your variables are normally distributed, but it will work for other distributions if the sample size is large enough.

There are two ways to call this command: by supplying it with needed sample statistics (mean, standard deviation, and sample size, for both data sets), or by entering two lists and letting the calculator work the statistics out. In either case, you will need to enter the desired confidence level as well.

In the summary stats syntax, *x _{1}* and

*x*the two sample means,

_{2}*s*and

_{1}*s*are the two sample standard deviations, and

_{2}*n*and

_{1}*n*the two sample sizes.

_{2}The output will contain an open interval (a, b) that is your answer: the difference between the two means will lie in this interval. Specifically, it is the second mean subtracted from the first - μ_{1}-μ_{2}. If you're interested in the reverse difference, just flip the signs on the interval.

Tip: don't use this command in a matched-pairs setting when you can match the two samples up by units or subjects. Instead, take the difference between the two samples in each matched pair, and use a regular TInterval.

# Sample Problem

You want to compare the average height of a freshman and a senior at your school. You haven't asked everyone, but you took a random sample of 40 people from each class and found out their heights (and stored them to L_{1} and L_{2}). You've decided to use a 95% confidence interval.

Based on the data list syntax for a 2-SampTInt, here is your code:

```
:2-SampTInt L1,L2,95
you can also use
:2-SampTInt L1,L2,.95
```

Alternatively, you could calculate the mean and sample size and enter those instead. The sample size in this case is 40 for both data sets; let's say the means were 57 inches and 67 inches and the standard deviations 5.2 and 7.1 inches. You now have all the needed statistics:

*x*is the mean height of freshmen: 57 inches_{1}*s*is the sample standard deviation for freshmen: 5.2 inches_{1}*n*is the number of freshmen in the sample: 40_{1}*x*is the mean height of seniors: 67 inches_{2}*s*is the sample standard deviation for seniors: 7.1 inches_{2}*n*is the number of seniors in the sample: 40_{2}

This means that the code is:

```
:2-SampTInt 57,5.2,40,67,7.1,40,95
you can also use
:2-SampTInt 57,5.2,40,67,7.1,40,.95
```

Of course, the main use of the 2-SampTInt command is in a program. While you can enter the command on the home screen as well (just look in the catalog for it), it would probably be easier to select 2-SampTInt… from the STAT>TEST menu (see the sidebar), since you don't have to remember the syntax.

# Advanced Uses

As with most other statistical commands, you can add frequencies to the lists (only with the data list syntax, of course); if you do, both lists must have frequencies, and the arguments go in the order *first data list*, *second data list*, *first freq. list*, *second freq. list*. Each frequency list must contain non-negative real numbers, which can't be all 0.

There is a final argument to 2-SampTInt: *pooled*. It can be either 0 or 1 (although any argument that isn't 0 will get treated as a 1); the default value is 0. If the value is 1, then then the variances will be pooled: that is, the calculator will assume that the variances of the two populations are equal, and use a combined form of the two standard deviations in place of each population's individual standard deviation. Set this flag if you have reason to believe that the standard deviations are equal.

# Optimization

Using the data list syntax, all items are optional: the calculator will assume you want to use L1 and L2 for your data unless other lists are supplied, and that the confidence level you want is 95% unless you give another one. Using the summary stats syntax, the confidence level is also optional - again, the calculator will assume 95%. This means we can rewrite our code above in a simpler manner:

```
:2-SampTInt L1,L2,95
can be
:2-SampTInt
```

```
:2-SampTInt 57,5.2,40,67,7.1,40,95
can be
:2-SampTInt 57,5.2,40,67,7.1,40
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-samptint

The 2-SampTTest Command

Performs a *t* significance test to compare the means of two populations.

2-SampTTest [*list1*, *list2*, *frequency1*, *frequency2*, *alternative*, *pooled?* *draw?*]

(data list input)

2-SampTTest *x _{1}*,

*s*,

_{1}*n*,

_{1}*x*,

_{2}*s*,

_{2}*n*, [

_{2}*alternative*,

*pooled?*,

*draw?*]

(summary stats input)

While editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- 4 to select 2-SampTTest, or use arrows

(outside the program editor, this will select the 2-SampTTest… interactive solver)

TI-83/84/+/SE

2 bytes

2-SampTTest performs a *t* significance test to compare the means of two populations. This test is valid for simple random samples from populations with unknown standard deviations. In addition, either the populations must be normally distributed, or the sample sizes have to be sufficiently large (usually, greater than 10).

The logic behind the test is as follows: we want to test the hypothesis that the true means of the two populations are equal (the null hypothesis). The letter μ is used for a population mean, so this is usually written as μ_{1}=μ_{2}. To do this, we assume that this "null hypothesis" is true, and calculate the probability that the difference between the two means occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the means are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it.

In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the two means are not equal. However, in certain cases when we have reason to suspect that one mean is greater than the other (such as when we are trying to verify a claim that one mean is greater), our alternative hypothesis may be that the first mean is greater than the second (μ_{1}>μ_{2}) or less (μ_{1}<μ_{2}).

As for the 2-SampTTest command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list (*x _{1}* and

*x*are the sample means,

_{2}*s*and

_{1}*s*the sample standard deviations, and

_{2}*n*and

_{1}*n*the sample sizes). In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the

_{2}*alternative*argument. 0 indicates a two-sided hypothesis of

*μ*≠

_{1}*μ*, -1 indicates

_{2}*μ*<

_{1}*μ*, and 1 indicates

_{2}*μ*>

_{1}*μ*. (In fact, the calculator will treat any negative value as -1, and any positive value as 1).

_{2}Although you can access the 2-SampTTest command on the home screen, via the catalog, there's no need: the 2-SampTTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax.

In either case, it's important to understand the output of 2-SampTTest. Here are the meanings of each line:

- The first line, involving μ
_{1}and μ_{2}, is the alternative hypothesis. - t is the test statistic, the standardized difference between the means. If the null hypothesis is true, it should be close to 0.
- p is the probability that the difference between μ
_{1}and μ_{2}(the two means) would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. - x-bar
_{1}and x-bar_{2}are the two sample means. - Sx
_{1}and Sx_{2}are the two sample standard deviations. - n
_{1}and n_{2}are the sample sizes.

# Sample Problem

Your school claims that the average SAT score of students at the school is higher than at a rival school. You took samples of SAT scores from students at both schools (and stored them to L1 and L2).

Since the school's claim is that your school's score is higher, that will be your alternative hypothesis (*μ _{1}*>

*μ*), which corresponds to a value of 1. The code you'd use is:

_{2}`:2-SampTTest L1,L2,1`

Alternatively, you could calculate the mean, standard deviation, and size of your samples, and put those into the command instead. Suppose you obtained SAT scores from 60 students at your school and 40 students at the rival school, the means were 1737 and 1623, and the standard deviation 211 and 218. Then your code is:

`:2-SampTTest 1737,211,60,1623,218,40,1`

You will see the following output:

```
2-SampTTest
μ1>μ2
z=2.594854858
p=.0056059824
x1=1737
x2=1623
Sx1=211
Sx2=218
n1=60
n2=40
```

The most important part of this output is "p=.0056059824". This value of p is smaller than 1% or 0.01. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ_{1}>μ_{2}, that is, your school's average SAT score is indeed higher.

# Advanced Uses

The final optional argument of 2-SampTTest, *draw?*, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the distribution, and shade the area of the graph beyound the t statistic. In addition, the value of t and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output.

The optional argument *pooled?*, if given a nonzero value, will pool the standard deviations to find a combined value which will then be used for both populations. Use this feature if you have reason to believe that the two populations have the same standard deviation.

As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax). If you do, then both lists must have frequencies, and the order of the arguments would be *list1*, *list2*, *frequency1*, *frequency2*.

# Optimization

Some of the arguments of the 2-SampTTest command have default values, and the argument can be omitted if this value is accepted.

- The
*draw?*argument can be omitted if you don't want graphical output, although you could put "0" in as well. - If the
*draw?*argument is omitted, you can omit the*pooled?*argument if you do not want your standard deviations pooled. - If both the above arguments are omitted, and you're doing a two sided test, you may omit the
*alternative*argument. - With data list input, you can always omit the frequency lists if you won't be using them.
- With data list input, if the flags that go at the end are omitted, and you're using the default lists L1 and L2, you may omit those as well.

The code in the sample problem above can't be optimized, because the *alternative* argument is 1:

`:2-SampTTest L1,L2,1`

However, if we were doing a two-sided test, we could omit the *alternative* argument as well as the lists:

```
:2-SampTTest L1,L2,0
can be just
:2-SampTTest
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-sampttest

The 2-SampZInt( Command

Using either already-calculated statistics, or two data sets, computes a Z confidence interval for the difference between two sample means.

2-SampZInt(*σ _{1}*,

*σ*, [

_{2}*list1*,

*list2*, [

*frequency1*], [

*frequency2*], [

*confidence level*]

(data list input)

2-SampZInt(*σ _{1}*,

*σ*,

_{2}*x*,

_{1}*n*,

_{1}*x*,

_{2}*n*, level//

_{2}(summary stats input)

When editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- 9 to select 2-SampZInt(, or use arrows

(this key sequence will give you the 2-SampZInt… screen outside a program)

TI-83/84/+/SE

2 bytes

The 2-SampZInt( command uses the techniques of Z Intervals to compute an interval for the **difference** between the means of two independent populations, at a specified confidence level. Use 2-SampZInt( when you have two independent variables to compare, and you already know their standard deviations. The 2-SampZInt( command assumes that both variables are distributed normally, but it will work for other distributions if the sample size is large enough.

There are two ways to call this command: by supplying it with needed sample statistics (mean and sample size, for both data sets), or by entering two lists and letting the calculator work the statistics out. In either case, you will need to enter the standard deviation and desired confidence level as well.

In the data list syntax, *σ _{1}* and

*σ*are the two standard deviations.

_{2}In the summary stats syntax,

*σ*and

_{1}*σ*are the two standard deviations,

_{2}*x*and

_{1}*x*the two sample means, and

_{2}*n*and

_{1}*n*the two sample sizes.

_{2}The output will contain an open interval (a, b) that is your answer: the difference between the two means will lie in this interval. Specifically, it is the second mean subtracted from the first - μ_{1}-μ_{2}. If you're interested in the reverse difference, just flip the signs on the interval.

Tip: don't use this command in a matched-pairs setting when you can match the two samples up by units or subjects. Instead, take the difference between the two samples in each matched pair, and use a regular ZInterval.

# Sample Problem

You want to compare the average height of a freshman and a senior at your school. You haven't asked everyone, but you took a random sample of 40 people from each class and found out their heights (and stored them to L_{1} and L_{2}). You've read in your textbook that the standard deviation of teenagers' heights is usually 6 inches. You've decided to use a 95% confidence interval.

Based on the data list syntax for a 2-SampZInt(, here is your code:

```
:2-SampZInt(6,6,L1,L2,95
you can also use
:2-SampZInt(6,6,L1,L2,.95
```

Alternatively, you could calculate the mean and sample size and enter those instead. The sample size in this case is 40 for both data sets; let's say the means were 57 inches and 67 inches. You now have all the needed statistics:

*σ*is the standard deviation for freshmen: 6 inches_{1}*σ*is the standard deviation for seniors: also 6 inches_{2}*x*is the mean height of freshmen: 57 inches_{1}*n*is the number of freshmen in the sample: 40_{1}*x*is the mean height of seniors: 67 inches_{2}*n*is the number of seniors in the sample: 40_{2}

This means that the code is:

```
:2-SampZInt(6,6,57,40,67,40,95
you can also use
:2-SampZInt(6,6,57,40,67,40,.95
```

Of course, the main use of the 2-SampZInt( command is in a program. While you can enter the command on the home screen as well (just look in the catalog for it), it would probably be easier to select 2-SampZInt… from the STAT>TEST menu (see the sidebar), since you don't have to remember the syntax.

# Advanced Uses

As with most other statistical commands, you can add frequencies to the lists (only with the data list syntax, of course); if you do, both lists must have frequencies, and the arguments go in the order *first data list*, *second data list*, *first freq. list*, *second freq. list*. Each frequency list must contain non-negative real numbers, which can't be all 0.

# Optimization

Using the data list syntax, all items but the standard deviations are optional: the calculator will assume you want to use L1 and L2 for your data unless other lists are supplied, and that the confidence level you want is 95% unless you give another one. Using the summary stats syntax, the confidence level is also optional - again, the calculator will assume 95%. This means we can rewrite our code above in a simpler manner:

```
:2-SampZInt(6,6,L1,L2,95
can be
:2-SampZInt(6,6
```

```
:2-SampZInt(6,6,57,40,67,40,95
can be
:2-SampZInt(6,6,57,40,67,40
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-sampzint

The 2-SampZTest( Command

Performs a *z* significance test to compare the means of two populations.

2-SampZTest(*σ _{1}*,

*σ*//list2//, //frequency1//, //frequency2//, //alternative//, //draw?//

_{2}(data list input)

2-SampZTest(*σ _{1}*,

*σ*

_{2}*x*,

_{1}*n*,

_{1}*x*,

_{2}*n*, //draw?//

_{2}(summary stats input)

While editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- 3 to select 2-SampZTest(, or use arrows

(outside the program editor, this will select the 2-SampZTest… interactive solver)

TI-83/84/+/SE

2 bytes

2-SampZTest( performs a *z* significance test to compare the means of two populations. This test is valid for simple random samples from populations with known standard deviations. In addition, either the populations must be normally distributed, or the sample sizes have to be sufficiently large (usually, greater than 10).

The logic behind the test is as follows: we want to test the hypothesis that the true means of the two populations are equal (the null hypothesis). The letter μ is used for a population mean, so this is usually written as μ_{1}=μ_{2}. To do this, we assume that this "null hypothesis" is true, and calculate the probability that the difference between the two means occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the means are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it.

In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the two means are not equal. However, in certain cases when we have reason to suspect that one mean is greater than the other (such as when we are trying to verify a claim that one mean is greater), our alternative hypothesis may be that the first mean is greater than the second (μ_{1}>μ_{2}) or less (μ_{1}<μ_{2}).

As for the 2-SampZTest( command itself, there are two ways of calling it: after giving the two standard deviations, you may give it a list of all the sample data, or the necessary statistics about the list (*x _{1}* and

*x*are the sample means, and

_{2}*n*and

_{1}*n*are the sample sizes). In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the

_{2}*alternative*argument. 0 indicates a two-sided hypothesis of

*μ*≠

_{1}*μ*, -1 indicates

_{2}*μ*<

_{1}*μ*, and 1 indicates

_{2}*μ*>

_{1}*μ*. (In fact, the calculator will treat any negative value as -1, and any positive value as 1).

_{2}Although you can access the 2-SampZTest( command on the home screen, via the catalog, there's no need: the 2-SampZTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax.

In either case, it's important to understand the output of 2-SampZTest. Here are the meanings of each line:

- The first line, involving μ
_{1}and μ_{2}, is the alternative hypothesis. - z is the test statistic, the standardized difference between the means. If the null hypothesis is true, it should be close to 0.
- p is the probability that the difference between μ
_{1}and μ_{2}(the two means) would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. - x-bar
_{1}and x-bar_{2}are the two sample means. - n
_{1}and n_{2}are the sample sizes.

# Sample Problem

Your school claims that the average SAT score of students at the school is higher than at a rival school. You took samples of SAT scores from students at both schools (and stored them to L1 and L2). Although you didn't know the standard deviations, you decided to use the value 200 that you found online as an estimate.

You now have all the data. You're assuming *σ _{1}* and

*σ*are both 200; the two data lists are L1 and L2. Since the school's claim is that your school's score is higher, that will be your alternative hypothesis (

_{2}*μ*>

_{1}*μ*), which corresponds to a value of 1. The code you'd use is:

_{2}`:2-SampZTest(200,200,L1,L2,1`

Alternatively, you could calculate the mean and sample size of your sample, and put those into the command instead. Suppose you obtained SAT scores from 60 students at your school and 40 students at the rival school, and that the means were 1737 and 1623. Then your code is:

`:2-SampZTest(200,200,1737,60,1623,40,1`

You will see the following output:

```
Z-Test
μ1>μ2
z=2.792418307
p=.0026158434
x1=1737
x2=1623
n1=60
n2=40
```

The most important part of this output is "p=.0026158434". This value of p is much smaller than 1% or 0.01. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ_{1}>μ_{2}, that is, your school's average SAT score is indeed higher.

# Advanced Uses

The final argument of 2-SampZTest(, *draw?*, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the **standard** normal curve, and shade the area of the graph beyond the z statistic. In addition, the value of z and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output.

As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax). If you do, then both lists must have frequencies, and the order of the arguments would be *list1*, *list2*, *frequency1*, *frequency2*.

# Optimization

Most of the arguments of the 2-SampZTest( command have default values, and the argument can be omitted if this value is accepted.

- The
*draw?*argument can be omitted if you don't want graphical output, although you could put "0" in as well. - If the
*draw?*argument is omitted, you can omit the*alternative*argument to use a two-sided test (*μ*≠_{1}*μ*). If you include the_{2}*draw?*argument, you have to include this - otherwise there will be confusion as to what the 5th argument means. - With data list input, you can always omit the frequency lists if you won't be using them.
- With data list input, if the
*draw?*and*alternative*arguments are omitted, and your data is in L1 and L2 (and you're not using frequency lists), you may omit L1 and L2 - those are default parameters. However, if*alternative*or*draw?*is present, you have to include it, or else the syntax may be confused with the syntax for summary stats input.

The code in the sample problem above can't be optimized, because the *alternative* argument is 1:

`:2-SampZTest(200,200,L1,L2,1`

However, if we were doing a two-sided test, we could omit the *alternative* argument as well as the lists:

```
:2-SampZTest(200,200,L1,L2,0
can be
:2-SampZTest(200,200
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-sampztest

The 2-Var Stats Command

Calculates some common statistics for two lists of data, and stores them to statistical variables. They're also displayed in a scrollable list, if done outside a program.

2-Var Stats [*list1*, *list2*, [*freqlist*]]

Press:

- STAT to access the statistics menu
- LEFT to access the CALC submenu
- 2 to select 2-Var Stats, or use arrows

TI-83/84/+/SE

1 byte

This command calculates a bunch of common (and a few uncommon) statistics for a pair of lists (it uses L1 and L2 by default, but you can use any list by supplying it as an argument). You have to store the lists to variables first, though, before calculating statistics for them. For example:

```
:{5,12,7,8,4,9→L1
:{1,0,2,5,7,4→L2
:2-Var Stats
```

The calculator treats the two lists as a list of ordered pairs. Some of the statistics calculated assume that this is the case, and the two lists are the same size: an error will occur if the lists don't match.

Like other statistical commands, you can use a frequency list as well, for cases where one element occurs more times than another (you can do this with a normal list, too, but that might be inconvenient when an element occurs very many times). There is only one frequency list for both data lists, and the frequency applies to the ordered pair formed by an element taken from each list. For example:

```
:{1,2,3→L1
:{1,2,3→L2
:{5,3,2→L3
:2-Var Stats L1,L2,L3
```

is the frequency-list equivalent of:

```
:{1,1,1,1,1,2,2,2,3,3→L1
:{1,1,1,1,1,2,2,2,3,3→L2
:2-Var Stats
```

When you're running it from the home screen, 2-Var Stats will display the statistics; this won't happen if you do it inside a program. Either way, it will also store what it calculated to the statistics variables found in VARS>Statistics… The variables 2-Var Stats affects are:

- $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\textrm{x}}$ is the mean (average) of the first list
- Σx is the sum of the first list
- Σx² is the sum of the squares of the first list
- Sx is the sample standard deviation of the first list
- σx is population standard deviation of the first list
- minX is the minimum element of the first list
- maxX is the maximum element of the first list
- $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\textrm{y}}$ is the mean (average) of the second list
- Σy is the sum of the second list
- Σy² is the sum of the squares of the second list
- Sy is the sample standard deviation of the second list
- σy is population standard deviation of the second list
- minY is the minimum element of the second list
- maxY is the maximum element of the second list
- Σxy is the sum of products of each matching pair of elements in the lists
- n is the number of elements in both lists

2-Var Stats will not work with "reserved" list names that the calculator uses internally. The only known such reserved list is the list RESID, and there's no reason to suspect there are any others. Ans, TblInput, and any expression which resolves to a list, are also not appropriate for this command: store all of these to a list before doing 2-Var Stats on them.

# Advanced uses

If you consider the two lists to be vectors, then Σxy is their dot product, and Σx² and Σy² are the squares of their norms; math done with these and other statistics can produce the shortest (but not necessarily quickest) way to calculate many vector operations.

# Optimization

Aside from statistical analysis, 2-Var Stats can also be used when you want to use the values it calculates more than once. This will save on size, since, for example Σx takes up less space than sum(L1), but considering how many calculations 2-Var Stats makes, it will usually be slower.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/2-var-stats

The ³ Command

Raises the input to the third power.

*value*³

While editing a program, press:

- MATH to enter the MATH menu
- 3 or use the arrow keys to select.

TI-83/84/+/SE

1 byte

The ³ command raises an input to the third power. It has exactly the same function as "^3", but is one byte smaller. If used on a list, it will return a list with all of the elements cubed. If used on a matrix, it will return the third matrix power of the input matrix.

```
2³
8
{1,‾2,3}³
{1 ‾8 27}
[[2,‾1][‾3,0]]³
[[20 ‾7]
[‾21 6]]
```

# Advanced Uses

One trick with ³ is to use it to save space (at the cost of speed) when using hard-coded values. For instance, use 5³ instead of 125 to save one byte.

# Optimization

Use this command instead of ^3 in all instances.

```
:X^3
can be
:X³
```

# Related Commands

^{-1}^{2}

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/3

The ³√( Command

Take the cube root of a number.

³√(*input*)

While editing a program, press:

- MATH to open the math menu
- 4 or use the arrow keys to select.

TI-83/84/+/SE

1 byte

Takes the cube root of a positive or negative number. It works exactly the same as 3^{×}√ or ^(1/3) but is smaller and uses an ending parenthesis. If used on a list, it will return a list with the cube root of each element.

```
³√(8)
2
³√(2)
1.25992105
³√({1,‾8,27})
{1 ‾2 3}
```

For complex numbers, the principal cube root is returned, which may be different from the cube root you'd get for the same real number:

```
³√(-8)
-2
³√(-8+0i)
1+1.732050808i
```

# Optimization

Never raise something to the one-third power explicitly; use this command instead.

```
:X^(1/3)→X
can be
:³√(X→X
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/cube-root

The a+bi Command

Puts the calculator into a+b*i* mode.

a+b*i*

Press:

- MODE to access the mode menu.
- Use the arrow keys and ENTER to select a+b
*i*

TI-83/84/+/SE

1 byte

The `a+b i` command puts the calculator into rectangular complex number mode. This means that:

- Taking square roots of negative numbers, and similar operations, no longer returns an error.
- Complex results are displayed in the form
`a+b`(hence the name of the command)*i*

This is the standard way of displaying complex numbers, though they can also be displayed in polar form (see `re^θi` for more details). To extract the coefficients a and b, use the `real(` and `imag(` commands.

# Advanced Uses

Rather than switch to a+b*i* mode, you might want to force the calculations to use complex numbers by making the original argument complex. The general way to do this is by adding +0*i* to the number. However, there may be an optimization in any particular case. See the quadratic formula routine for a good example of this.

```
Real
Done
√(-1)
(causes an error)
√(-1+0i)
i
```

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/a-bi

The abs( Command

Returns the absolute value of a real number, and the complex absolute value of a complex number.

abs(*value*)

Press:

- MATH to access the math menu.
- RIGHT to access the NUM submenu.
- ENTER to select abs(.

Alternatively, press:

- MATH to access the math menu.
- RIGHT twice to access the CPX (complex) submenu.
- 5 to select abs(, or use arrows.

TI-83/84/+/SE

1 byte

`abs( x)` returns the absolute value of the real number

*x*. Also works on a list or matrix of real numbers.

```
abs(3)
3
abs(‾3)
3
```

For complex numbers, `abs(z)` returns the absolute value (also known as the complex modulus, norm, or a hundred other terms) of the complex number *z*. If *z* is represented as *x*+i*y* where x and y are both real, `abs(z)` returns √(*x*²+*y*²). Also works on a list of complex numbers.

```
abs(3+4i)
5
```

# Optimization

The `abs(` command, used properly, may be a smaller method of testing if a variable is in some range. For example:

```
:If 10<X and X<20
can be
:If 5>abs(X-15
```

In general, the first number, A, in the expression `A>abs(X-B)` should be half the length of the range, half of 10 in this case, and the second number, B, should be the midpoint of the range (here, 15).

This can be taken to extreme degrees. For example, the following code uses abs( three times to test if X is the getKey keycode of one of the keys 1, 2, 3, 4, 5, 6, 7, 8, or 9:

`:If 2>abs(5-abs(5-abs(X-83`

For complex numbers given by a separate real and complex part, `abs(X+iY)` can be optimized to R►Pr(X,Y).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/abs

The and Command

Returns the logical value of *value1* and *value2* being true.

*value1* and *value2*

Press:

- 2nd TEST to access the test menu.
- RIGHT to access the LOGIC submenu.
- ENTER to select and.

TI-83/84/+/SE

1 byte

`and` takes two numbers, variables, or expressions and tests to see if they are both True (not equal to 0). If they are, it returns 1. If either input is False (0), it returns 0. Note that the order of the operators doesn't matter (i.e. `and` is commutative), and that multiple `and`'s can be used together

```
:0 and 0
0
:0 and 1
0
:1 and 2 (2 counts as True, just like one)
1
:1→X
:X and 2+2 (you can use variables and expressions)
1
:1 and 1 and 2-2 (the last input evaluates to 0, or false)
0
```

# Optimization

Multiplying two values has the same truth value as `and`; thus, `and` can sometimes be replaced by multiplication. Because the calculator does implicit multiplication, meaning it automatically recognises when you want to multiply, you don't need to use the * sign.

```
:If A and B
can be
:If AB
```

However, do not use this optimization if A and B might be expected to take on large values, as an overflow error might occur.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/and

The and Command

Tests if two conditions are both true.

Can also be used as a bitwise "and" on integers.

*condition1* and *condition2*

*integer1* and *integer2*

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press 8 to enter the Test submenu.
- Press 8 to select and.

This command works on all calculators.

1 byte

The `and` operator combines two conditions into one, which will be true if both sides are true, and false otherwise. You can create these conditions with the relational operators =, ≠, >, ≥, <, and ≤, with functions such as isPrime(), pxlTest(), and ptTest(), or with any other expression that returns 'true' or 'false'. Other operators for dealing with conditions are or, xor, and not.

```
:2+2=4 and 1=0
false
:2+2=4 and 1+1=2
true
```

The operator can also be applied to integers, treating them as 32-bit signed integers (larger integers will be truncated to fit) expressed in binary. The bits will be matched up, and "and" will be applied to the bits individually — a bit in the result will be 1 if the two corresponding bits of the original integers were 1, and 0 otherwise.

```
:(0b11111100 and 0b00111111)▶Bin
0b111100
:1000 and 512
512
```

In complicated logical expressions (both with conditions and with integers), `and` has greater priority than the others ("or" and "xor"). For instance:

`X or Y and Z`

will be interpreted as:

`X or (Y and Z)`

# Error Conditions

**60 - Argument must be a Boolean expression or integer** happens when the data type is incorrect (or mismatched).

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:and

The AndPic Command

Logically "ands" a picture variable and the graph screen at *[row, column]*

AndPic *picVar*,*[row, column]*

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

The `AndPic` command logically takes the picture variable specified, and takes the current graph, and it finds the points at which both the graph and the picture have pixels, and it displays them only. If specified, *[row,column]* tells where the top left corner of the picture is to be placed. If not specified, the default is (0,0), which is the top left corner of the screen.

# Error Conditions

**260 - Domain error** happens when the *[row,column]* argument is outside the screen range..

**960 - Undefined variable** happens when the picture variable specified does not exist..

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:andpic

The angle( Command

Returns the complex argument of a complex number.

angle(*z*)

Press:

- MATH to access the math menu.
- RIGHT, RIGHT to access the CPX (complex) submenu
- 4 to select angle(, or use arrows.

TI-83/84/+/SE

2 bytes

`angle(z)` returns the complex argument (also known as the polar angle) of the complex number *z*. If *z* is represented as *x*+i*y* where *x* and *y* are both real, `angle(z)` returns R►Pθ(*x*,*y*) (which is equivalent to tanֿ¹(*y**/x*) if x is nonzero). Also works on a list of complex numbers.

```
angle(3+4i)
.927295218
R►Pθ(3,4)
.927295218
```

When writing a complex number *z* in the form $re^{i\theta}$ (or, equivalently, $r(\cos\theta+i\sin\theta)$), then $\theta$ is equal to the value of `angle(z)`, suitably reduced so that the result returned is in the interval $-\pi<\theta\leq\pi$.

The `angle(` command also works on matrices, though not in any useful way: `angle(`[A] will return a matrix of the same size as [A], but with all elements 0. If you plan to use this, **don't**: 0[A] does the same thing, but is smaller and not as questionable (because this behavior is clearly unintentional on TI's part, and may be changed in an OS update).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/angle

The ANOVA( Command

Performs a one way ANOVA (analysis of variance) test to compare the means of multiple populations (up to 20).

ANOVA(*list*, *list*, …

Press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- ALPHA F to select ANOVA(, or use arrows

Change the last keypress to ALPHA H on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE

2 bytes

The `ANOVA` (analysis of variance) command is used to test if there is a significant difference between the means of several populations (this is an extension of the two-sample t-test which compares only two populations). The calculator assumes the null hypothesis, that all means are equal, and returns a probability value, p, of the differences in the data occurring if the null hypothesis were true. If p is small (usually, if it's less than .05), then it's unlikely we'd get such differences just by chance if the null hypothesis were true, so we reject it and conclude that at least one of the means is different.

There are two reasons why we don't test the means in pairs using a simpler test. First of all, it would take a long time: there's so many pairs to compare. Second of all, when you're doing many tests, there's a high probability you'll get a low p-value by chance. Imagine that you're doing 10 tests. If the probability of getting a low p-value on one test is .05, then the probability that at least one test will return one is 1-.95^{10}: about 0.4 - this is quite likely to happen. The `ANOVA` test avoids this by having only one null hypothesis to test.

If you're only interested in the result of the test, the only thing you'll need in the output is the second line: "p=…" This is your p-value, and determines whether you should reject the null hypothesis or not. If you need more detail, here are the meanings of the other variables:

**F**is the test statistic. If the null hypothesis is true, it should follow Snedecor's F distribution, and Fcdf( can be used to determine the p-value.- For both Factor and Error:
- MS is the mean squares (SS/df). If the null hypothesis is true, Factor MS should be roughly equal to Error MS
- SS is the sum of squares - see the TI-83+ Manual for formulas
- df is the number of degrees of freedom - for Factor, it's the df between the categorical variables, and for Error, it's the sum of df between each variable.

- Sxp is the pooled variation.

# Advanced Uses

The statistics **F**, p, and Sxp will be stored to the appropriate variables after this test. The other six statistics do not have a normal variable associated with them. However, the two-byte tokens 0x6237 through 0x623C are, in fact, used to store the values of Factor MS, Factor SS, Factor df, Error MS, Error SS, and Error df respectively. They can't be accessed through a menu, but if you use a hex editor to paste them into your program, you will be able to use them just like any other variable.

However, be careful because the Factor and Error tokens look exactly alike (even though they refer to different variables), and can be confused. Also, there is a chance that future OS versions will change the behavior of `ANOVA(`, though this is unlikely, and this trick will no longer work.

# Error Conditions

**ERR:ARGUMENT**is thrown if one of the lists is blank, only one list is used, or the function is completely blank.**ERR:SYNTAX**is thrown if you do not use lists (Matrixes, numbers,etc)- *
**ERR:INVALID DIM**is thrown if you use a list that has 0 or a negative number. - *
**ERR:DATA TYPE**is thrown by using "l" or a list with a different set of data.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/anova

The Ans Variable

Returns the last answer.

Ans[*→Variable*]

While editing a program, press [2nd] then [(-)]

TI-83/84/+/SE

1 byte

The `Ans` variable holds the last answer that was stored in the calculator. Because `Ans` is stored in a special storage area built-in to the calculator, and it is extensively used by the calculator, you cannot delete it. Ans is also useful; it can make your programs both smaller and faster:

- Unlike other variables which have a value type hard-coded in (i.e., a string can only hold text, and lists and matrices can only hold numbers),
`Ans`can take on whatever value you want: a real or complex, list, matrix, or string are all acceptable. - Along with the finance variables,
`Ans`is faster than the real, complex, list, matrix, and string variables; and subsequently, you should try to use it as much as possible.

One of the most common places to use `Ans` is in place of storing a value to a variable. Just paste the `Ans` variable to the location where the variable was called, and then when the expression is evaluated, the calculator will use the current value of `Ans`. Using the `Ans` variable allows you to eliminate the variable, which helps save a little or a lot of memory (depending on the type of variable and its size).

```
30+5A→B
Disp 25A,30+5A
;can be
30+5A
Disp 25A,Ans
```

The one major drawback to using `Ans` is that its current value is only temporary. Whenever you store a value to a variable, place an expression or string on a line by itself, or use the optional argument of the `Pause` command, `Ans` is updated to the new value. This restriction essentially limits your use of `Ans` to only a single variable. If you are manipulating two or more variables, it's best to just use the variables.

There are several cases in which changing the value of a variable does not modify `Ans`, thus preserving its current value for later use:

- storing to an equation variable
- using the
`DelVar`command to delete a variable (i.e., set its value to zero, if it's a real variable) - changing the value with
`IS>(`or`DS<(`. - initializing or changing the value in a
`For(`loop.

These cases can be very useful, allowing you to use Ans to store an expression rather than create a temporary variable for it.

# Timing

Storing a real value into `Ans` takes approximately 1.0 ms. This does not include the time needed to compute or retrieve the value, which may be significant.

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/ans

The approx() Command

Gives a decimal approximation of an expression.

approx(*expression*)

**Menu Location**

While on the home screen:

- Press F2 to enter the Algebra menu.
- Press 5 to paste approx(.

This command works on all calculators.

1 byte

The `approx()` command forces an expression to be evaluated in approximate mode, temporarily ignoring the mode setting. It's equivalent to pressing ♦ and ENTER when performing a calculation on the home screen.

```
:approx(π)
3.14159265359
```

When applied to a complicated expression, matrix, or list, it approximates every number that occurs there.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:approx

The Archive Command

Moves a variable from RAM to the archive.

Archive *variable*

Press:

- 2nd MEM to access the memory menu
- 5 to select Archive, or use arrows

TI-83+/84+/SE

(not available on the regular TI-83)

2 bytes

The `Archive` command moves a variable from RAM to the archive (also known as ROM). A quick synopsis of the difference between the two:

- Data in the archive cannot be accessed, but it's protected from RAM clears (which may occur during battery removal if not done carefully); also, the archive can hold much more data.
- Data in RAM can be accessed for calculations, but it can also be deleted during a RAM clear or accidentally overwritten by another program.

Nothing happens if the variable in question is already archived.

You might want to use this command to protect data such as saved games from being accidentally deleted. It's not, in general, a good idea to archive commonly used variables, such as the real variables A-Z, since programs usually expect to be able to access these variables without problems, and won't check if they're archived.

Also, some variables cannot be archived. These include:

- The real variables R, T, X, Y, θ, and
*n*(due to their use in graphing) - The equation variables Y
_{n}, X_{nT}, Y_{nT}, r_{n}, u, v, and w - The stat plots Plot
*#* - Window, table, and zoom variables such as TblInput or Xmin
- Statistical variables and the list ∟RESID
- Finance variables

Finally, the `Archive` command does not work on programs when using it from a program (it does, however, archive programs from the home screen). However, an assembly program can be executed as a subroutine so that `Archive` and `UnArchive` can be used within a program. The program should however be run again afterwards.

# Advanced Uses

As archived variables (and programs) can not be accessed by the calculator's inbuilt OS, archiving programs can be quite problematic when trying to execute them. However; by enabling your programs to be viewable in assembly shells, you can execute your programs without needing to unarchive them first. This is because the assembly shell *copies* the program to the RAM automatically, and is then executed. Closing the program will automatically remove the copy from the RAM, so no RAM is lost in the end.

# Error Conditions

**ERR:ARCHIVE FULL**is thrown when there isn't enough space in the archive for the variable.**ERR:INVALID**is thrown when trying to archive a program from within a program.**ERR:VARIABLE**is thrown when trying to archive a variable that cannot be archived.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/archive

The Archive Command

Moves a variable from RAM to the archive.

Archive *variable*, [*another*, …]

**Menu Location**

Starting in the program editor:

- Press F4 to enter the Var menu.
- Press 8 to select Archive.

This command works on all calculators.

3 bytes

The `Archive` command moves a variable, or several variables, from RAM to the archive. This serves two purposes:

- More RAM is now available for other variables.
- The variable is protected from being edited or deleted.

On the 68k series of calculators, a variable in the archive can still be read (compare this to the behavior of TI-83 series calculators, where doing anything at all to an archived variable is forbidden). However, trying to store anything to the variable will give an error: it must be unarchived first.

Variables in the archive are also protected from being deleted. This means that a `DelVar` command called on it will cause an error. Commands such as `NewProb` or `DelType` that delete multiple variables will skip over any that are archived. Finally, in the event of a RAM clear (which is more likely to happen by accident than a total memory clear), archived variables will be preserved.

Any type of variable can be archived. However, you cannot archive system variables (such as xmin) or variables beginning with _.

# Advanced Uses

It seems natural to archive programs, since they usually aren't written to, and they are valuable enough that you want to give them some protection. However, keep in mind that the first time you run a program after editing it, it gets tokenized — the text is converted into tokens that stand in for commands. The process might take several seconds.

If you edit a program and then immediately archive it, it is "protected" from this conversion process. That means that *every* time you run the program, it will be tokenized. To avoid this, run the program once to tokenize it, and then archive it.

# Error Conditions

**140 - Argument must be a variable name** happens when archiving a system variable or an invalid variable name.

**870 - Reserved name or system variable** happens when archiving a variable starting with _.

**960 - Undefined variable** happens when archiving an undefined variable.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:archive

The arcLen() Command

Returns the arc length of *expression1* from *start* to *end* with respect to variable *var*.

arcLen(*expression1*,*var*,*start*,*end*)

**Menu Location**

Describe how to get the command from a menu.

This command works on all calculators.

X byte(s)

The `arcLen()` command uses the integral arc length formula to calculate the arc length of a function over the specified interval.

```
arcLen(cos(x),x,0,π)
3.82019...
```

# Advanced Uses

The `arcLen()` command also works on lists of expressions:

```
arcLen({sin(x),cos(x)},x,0,π)
{3.820... 3.810...}
```

Separate unrelated advanced uses with a horizontal bar.

# Optimization

This section includes both ways to optimize use of the command, and other common pieces of code that this command can replace in an optimization. Make sure to mention if the optimization improves speed of the program, size, or both. Sample code should be included too, preferably in the following format:

```
:∫(√(1+d(f(x),x)²),x,a,b)
can be
:arcLen(f(x),x,a,b)
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:arclen

The Asm( Command

Runs an assembly program.

Asm(prgm*NAME*)

This command is only found in the catalog. Press:

- 2nd CATALOG to access the command catalog.
- DOWN six times.
- ENTER to select Asm(.

TI-83+/84+/SE

(not available on the regular TI-83)

2 bytes

The `Asm(` command is used for running an assembly program. Unlike TI-Basic programs, assembly programs are written in the calculator's machine code directly, which makes them more powerful in both speed and functionality. However, it also means that if they crash, they crash hard — there is no built-in error menu to protect you.

Keep in mind that many assembly programs these days are written for a shell such as Ion or MirageOS. If you're dealing with one of those programs, calling `Asm(` on it will do nothing; you need to get the appropriate shell and run that instead.

With the `AsmPrgm` and `AsmComp(` commands, you can create small assembly programs yourself, directly on the calculator. If you are using at TI-84+CE with OS 5.3, the `Asm(` is unnecessary to run such programs.

# Error Conditions

**ERR:INVALID**is thrown if the program isn't an assembly program.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/asm-command

The AsmComp( Command

Compresses an assembly program in hexadecimal form into binary form.

Asm(prgm*ORIGINAL*,prgm*RESULT*)

This command is only found in the catalog. Press:

- 2nd CATALOG to access the command catalog.
- Scroll down to AsmComp( and press enter.

TI-83+/84+/SE/CSE/CE

(not available on the regular TI-83)

2 bytes

This command is used to compress an assembly program written using `AsmPrgm` into an "assembled" assembly program. This will make the program about twice as small, and protect it from being edited, in addition to making execution faster.

To use `AsmComp(`, give it the ASCII represented assembly program, followed by the name you want the assembled program to have. That name can't be already taken. Since it's not easy to rename an assembled assembly program, if you want to write a program called prgmGAME, you type the ASCII represented code in a program with a different name (e.g. GAMEA) and then do `AsmComp(`(prgmGAMEA,prgmGAME).

Assembly programs can be run with `Asm(`.

# Error Conditions

**ERR:DUPLICATE**is thrown if prgm*RESULT*is an already used program name;**ERR:INVALID**is thrown if prgm*ORIGINAL*doesn't start with`AsmPrgm`;**ERR:SYNTAX**is thrown if prgm*ORIGINAL*is not an assembly program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/asmcomp

The AsmPrgm Command

This command must be the beginning of an assembly program.

AsmPrgm

This command is only found in the catalog. Press:

- 2nd CATALOG to access the command catalog.
- Scroll down to AsmPrgm and press ENTER.

TI-83+/84+/SE/CSE/CE

(not available on the regular TI-83)

2 bytes

This command denotes the start of an assembly program in hexadecimal form. The command must go at the beginning of a program.

Using `AsmPrgm` is the only built-in way to create assembly programs on the calculator, and it's not very convenient. To use it, after `AsmPrgm` itself, you must type in the hexadecimal values (using the numbers 0-9, and the letters A-F) of every byte of the assembly program. Even for assembly programmers, this is a complicated process: unless you've memorized the hexadecimal value of every assembly command (which is about as easy as memorizing the hexadecimal value of every TI-Basic token) you have to look every command up in a table.

In addition, it's easy to make a typo while doing this. For this reason, it's recommended **not** to use `AsmPrgm` to write assembly programs on the calculator, but instead write assembly programs on the computer. This also lets you use emulators and debuggers and such, as opposed to crashing your calculator (possibly permanently) every time you have a bug.

Just about the only use for `AsmPrgm` is to enter the hex codes for simple assembly routines that can be called from Basic programs or used for some other short task. For example, the following program will allow you to type in lowercase letters (by pressing ALPHA twice, you go into lowercase letter mode):

`AsmPrgmFDCB24DEC9`

To use this, create a program, and enter the code above into it. Then run the program using `Asm(`. Voila! Lowercase letters are now enabled.

More such short programs can be found here.

# TI-84+ Color Calculators

For the TI-84+ C series of calculators, `AsmPrgm` has been replaced by two new commands: `AsmPrgm84C` for the TI-84+ CSE and `AsmPrgmCE` for the TI-84+ CE. The commands function in the exact same manner as the original `AsmPrgm` command. However, it is important to note that sending assembly programs between a CSE and CE (or vice versa) may cause errors due to a difference in commands.

Many of the hex codes involving `AsmPrgm` also no longer function correctly on C series calculators. The updated hex codes can be found here.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/asmprgm

The augment( Command

Combines two lists or matrices into one. In the case of matrices, this is done horizontally rather than vertically.

augment(*list1*,*list2*

augment(*matrix1*,*matrix2*

Press:

- 2nd LIST to access the List menu
- RIGHT to access the OPS submenu
- 9 to select augment(, or use arrows

Alternatively, press:

- MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the Matrix menu
- RIGHT to access the MATH submenu
- 7 to select augment(, or use arrows

TI-83/84/+/SE

1 byte

The `augment(` command is used to combine two lists or two matrices into one. For lists, this is done the obvious way: adding the elements of the second on to the elements of the first. For example:

```
augment({1,2,3,4},{5,6,7
{1 2 3 4 5 6 7}
```

For matrices, the columns of the second matrix are added after the columns of the first matrix: an R by C matrix augmented with an R by D matrix will result in an R by (C+D) matrix. For example:

```
augment([[1][2]],[[3][4]
[[1 3]
[2 4]]
```

# Advanced Uses

Use the ` ^{T}` (transpose) command if you want to combine two matrices vertically, rather than horizontally. For example:

```
augment([[1,2]]T,[[3,4]]T)T
[[1 2]
[3 4]]
```

# Optimization

You may be tempted to use `augment(` to add one element to the end of a list:

`:augment(L1,{X→L1`

However, the following way is faster and more memory-efficient while the program is running (although it increases the program's size):

`:X→L1(1+dim(L1`

# Error Conditions

**ERR:DATA TYPE**is thrown if you try to augment a single number to a list, a common error — use {X instead of X.**ERR:DIM MISMATCH**is thrown if you try to augment two matrices with a different number of rows.**ERR:INVALID DIM**is thrown if one of the arguments is a list with dimension 0, or if the result would have dimension over 999 (for lists) or 99x99 (for matrices).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/augment

The AUTO Answer Command

Mode command that sets Answers to AUTO.

AUTO Answer

Press:

- MODE
- DOWN until you see Answers
- ENTER on AUTO

Alternatively, access the catalog.

TI-84 2.53MP only

2 bytes

The `AUTO Answer` command is a mode command that changes the Answers mode to AUTO. The AUTO mode is in essence the same mode that lower OS models use. The calculator will evaluate a numerical expression and return a decimal or number in scientific notation, unless `►Frac` is used.

In the Mathprint mode, no noticeable difference is seen unless the answer is converted to a fraction.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/auto-answer

The AxesOff Command

Disables the X- and Y- axes on the graph screen.

AxesOff

Press:

- 2nd FORMAT to access the format menu.
- Use arrows and ENTER to select AxesOff.

TI-83/84/+/SE

2 bytes

The `AxesOff` command disables the X and Y axes on the graph screen, so that they aren't drawn. They can be enabled again with the `AxesOn` command.

(the y=x line that is drawn when both `Seq` and `Web` modes are enabled is also controlled by this command)

Generally, the `AxesOff` command should be used at the beginning of the program to disable the axes if the program is going to use the graph screen, since the axes get in the way. However, you should consider using `StoreGDB` and `RecallGDB` to save this setting if that's the case.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/axesoff

The AxesOn Command

Enables the X- and Y- axes on the graph screen.

AxesOn

Press:

- 2nd FORMAT to access the format menu.
- Use arrows and ENTER to select AxesOn.

TI-83/84/+/SE

2 bytes

The `AxesOn` command enables the X and Y axes on the graph screen, so that they are drawn. They can be disabled with the `AxesOff` command.

(the y=x line that is drawn when both `Seq` and `Web` modes are enabled is also controlled by this command)

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/axeson

The bal( Command

Calculates the remaining balance after *n* payments in an amortization schedule.

bal(*n*,[*roundvalue*]

On the TI-83, press:

- 2nd FINANCE to access the finance menu.
- 9 to select bal(, or use arrows and ENTER.

On the TI-83+ or higher, press:

- APPS to access the applications menu.
- 1 or ENTER to select Finance…
- 9 to select bal(, or use arrows and ENTER.

TI-83/84/+/SE

2 bytes

The `bal(` command calculates the remaining balance after *n* payments in an amortization schedule. It has only one required argument: *n*, the payment number. However, it also uses the values of the finance variables PV, PMT, and I% in its calculations.

The optional argument, *roundvalue*, is the number of digits to which the calculator will round all internal calculations. Since this rounding affects further steps, this isn't the same as using `round(` to round the result of `bal(` to the same number of digits.

Usually, you will know the values of **N**, PV, and I%, but not PMT. This means you'll have to use the finance solver to solve for PMT before calculating `bal()`; virtually always, FV will equal 0.

# Sample Problem

*Imagine that you have taken out a 30-year fixed-rate mortgage. The loan amount is $100000, and the annual interest rate (APR) is 8%. Payments will be made monthly. After 15 years, what amount is still left to pay?*

We know the values of **N**, I%, and PV, though we still need to convert them to monthly values (since payments are made monthly). **N** is 30*12, and I% is 8/12. PV is just 100000.

Now, we use the finance solver to solve for PMT. Since you intend to pay out the entire loan, FV is 0. Using either the interactive TVM solver, or the `tvm_Pmt` command, we get a value of about -$733.76 for PMT.

We are ready to use `bal(`. We are interested in the payment made after 15 years; this is the 15*12=180^{th} payment. `bal(180)` gives us the result $76781.55 — as you can see, most of the loan amount is still left to pay after 15 years.

# Formulas

The calculator uses a recursive formula to calculate `bal()`:

In the case that *roundvalue* is given as an argument, the rounding is done at each step of the recurrence (which virtually forces us to use this formula). Otherwise, if no rounding is done (and assuming I% is not 0), we can solve the recurrence relation to get:

# Error Conditions

**ERR:DOMAIN**is thrown if the payment number is negative or a decimal.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/bal

The binomcdf( Command

Calculates the binomial cumulative probability, either at a single value or for all values

for a single value:

binomcdf(*trials*, *probability*, *value*

for a list of all values (0 to *trials*)

binomcdf(*trials*, *probability*

Press:

- 2ND DISTR to access the distribution menu
- ALPHA A to select binomcdf(, or use arrows.

Press ALPHA B instead of ALPHA A on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE

2 bytes

This command is used to calculate the binomial cumulative probability function. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions:

- A specific event has only two outcomes, which we will call "success" and "failure"
- This event is going to repeat a specific number of times, or "trials"
- Success or failure is determined randomly with the same probability of success each time the event occurs
- We're interested in the probability that there are
**at most**N successes

For example, consider a couple that intends to have 4 children. What is the probability that at most 2 are girls?

- The event here is a child being born. It has two outcomes "boy" or "girl". In this case, since the question is about girls, it's easier to call "girl" a success.
- The event is going to repeat 4 times, so we have 4 trials
- The probability of a girl being born is 50% or 1/2 each time
- We're interested in the probability that there are at most 2 successes (2 girls)

The syntax here is `binomcdf( trials, probability, value)`. In this case:

`:binomcdf(4,.5,2`

This will give .6875 when you run it, so there's a .6875 probability out of 4 children, at most 2 will be girls.

An alternate syntax for `binomcdf(` leaves off the last argument, *value*. This tells the calculator to compute a list of the results for all values. For example:

`:binomcdf(4,.5`

This will come to {.0625 .3125 .6875 .9375 1} when you run it. These are all the probabilities we get when you replace "at most 2 girls" with "at most 0", "at most 1", etc. Here, .0625 is the probability of "at most 0" girls (or just 0 girls), .3125 is the probability of at most 1 girl (1 or 0 girls), etc.

Several other probability problems actually are the same as this one. For example, "less than N" girls, just means "at most N-1" girls. "At least N" girls means "at most (total-N)" boys (here we switch our definition of what a success is). "No more than", of course, means the same as "at most".

# Advanced (for programmers)

The `binompdf(` and `binomcdf(` commands are the only ones apart from `seq(` that can return a list of a given length, and they do it much more quickly. It therefore makes sense, in some situations, to use these commands as substitutes for `seq(`.

Here's how to do it:

`cumSum(``binomcdf(`N,0 gives the list {1 2 … N+1}, and`cumSum(``not(``binompdf(`N,0 gives the list {0 1 2 … N}.- With
`seq(`, you normally do math inside the list:`seq(`3I^{2},I,0,5 - With these commands, you do the same math outside the list: 3
`Ans`^{2}where`Ans`is the list {0 1 … 5}.

```
:seq(2^I,I,1,5
can be
:cumSum(binomcdf(4,0
:2^Ans
which in turn can be
:2^cumSum(binomcdf(4,0
```

In general (where f() is some operation or even several operations):

```
:seq(f(I),I,1,N
can be
:cumSum(binomcdf(N-1,0
:f(Ans
which can sometimes be
:f(cumSum(binomcdf(N-1,0
```

If the lower bound on I in the `seq(` statement is 0 and not 1, you can use `binompdf(` instead:

```
:seq(f(I),I,0,N
can be
:cumSum(not(binompdf(N,0
:f(Ans
which can sometimes be
:f(cumSum(not(binompdf(N,0
```

This will not work if some command inside `seq(` can take only a number and not a list as an argument. For example, seq(L_{1}(I),I,1,5 cannot be optimized this way.

# Formulas

Since "at most N" is equivalent to "0 or 1 or 2 or 3 or … N", and since we can combine these probabilities by adding them, we can come up with an expression for `binomcdf(` by adding up values of `binompdf(`:

(If you're not familiar with sigma notation, $\sum_{i=0}^{k}$ just means "add the following up for each value of i 0 through k")

# Error Conditions

**ERR:DATATYPE**is thrown if you try to generate a list of probabilities with*p*equal to 0 or 1, and at least 257 trials.**ERR:DOMAIN**is thrown if the number of trials is at least 1 000 000, unless the other arguments make the problem trivial.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/binomcdf

The binompdf( Command

Calculates the binomial probability, either at a single value or for all values

for a single value:

binompdf(*trials*, *probability*, *value*

for a list of all values (0 to *trials*)

binompdf(*trials*, *probability*

Press:

- 2ND DISTR to access the distribution menu
- 0 to select binompdf(, or use arrows.

Press ALPHA A instead of 0 on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE

2 bytes

This command is used to calculate the binomial probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions:

- A specific event has only two outcomes, which we will call "success" and "failure"
- This event is going to repeat a specific number of times, or "trials"
- Success or failure is determined randomly with the same probability of success each time the event occurs
- We're interested in the probability that there are exactly N successes

For example, consider a couple that intends to have 4 children. What is the probability that 3 of them are girls?

- The event here is a child being born. It has two outcomes "boy" or "girl". We can call either one a success, but we'll choose to be sexist towards guys and call a girl a success in this problem
- The event is going to repeat 4 times, so we have 4 trials
- The probability of a girl being born is 50% or 1/2 each time
- We're interested in the probability that there are exactly 3 successes (3 girls)

The syntax here is `binompdf(`*trials*, *probability*, *value*). In this case:

`:binompdf(4,.5,3`

This will give .25 when you run it, so there's a .25 (1/4) probability out of 4 children, 3 will be girls.

An alternate syntax for `binompdf(` leaves off the last argument, *value*. This tells the calculator to compute a list of the results for all values. For example:

`:binompdf(4,.5`

This will come to {.0625 .25 .375 .25 .0625} when you run it. These are the probabilities of all 5 outcomes (0 through 4 girls) for 4 children with an equal probability of being born. There's a .0625 probability of no girls, a .25 probability of 1 girl, etc.

# Advanced (for programmers)

The `binompdf(` and `binomcdf(` commands are the only ones apart from `seq(` that can return a list of a given length, and they do it much more quickly. It therefore makes sense, in some situations, to use these commands as substitutes for `seq(`.

Here's how to do it:

`cumSum(``binomcdf(`N,0 gives the list {1 2 … N+1}, and`cumSum(``not(``binompdf(`N,0 gives the list {0 1 2 … N}.- With
`seq(`, you normally do math inside the list: for example,`seq(`3I^{2},I,0,5 - With these commands, you do the same math outside the list: 3
`Ans`^{2}where`Ans`is the list {0 1 … 5}.

An example:

```
:seq(2^I,I,1,5
can be
:cumSum(binomcdf(4,0
:2^Ans
which in turn can be
:2^cumSum(binomcdf(4,0
```

In general (where f() is some operation or even several operations):

```
:seq(f(I),I,1,N
can be
:cumSum(binomcdf(N-1,0
:f(Ans
which can sometimes be
:f(cumSum(binomcdf(N-1,0
```

If the lower bound on I in the `seq(` statement is 0 and not 1, you can use `binompdf(` instead:

```
:seq(f(I),I,0,N
can be
:cumSum(not(binompdf(N,0
:f(Ans
which can sometimes be
:f(cumSum(not(binompdf(N,0
```

This will not work if some command inside `seq(` can take only a number and not a list as an argument. For example, seq(L_{1}(I),I,1,5 cannot be optimized this way.

# Formulas

The value of `binompdf(` is given by the formula

This formula is fairly intuitive. We want to know the probability that out of n trials, exactly k will be successes, so we take the probability of k successes - $p^k$ - multiplied by the probability of (n-k) failures - $(1-p)^{n-k}$ - multiplied by the number of ways to choose which k trials will be successes - $\binom{n}{k}$.

# Error Conditions

**ERR:DOMAIN**is thrown if the number of trials is at least 1 000 000 (unless the other arguments make the problem trivial)

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/binompdf

The ceiling() Command

Returns the ceiling of a number.

ceiling(*value*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press 1 to enter the Number submenu.
- Press 7 to select ceiling(.

This command works on all calculators.

1 byte

The `ceiling()` command rounds a number up to the nearest integer at least as large as the number. For instance, `ceiling(π)` returns 4, while `ceiling(-π)` returns -3.

There are several commands available to round a number to an integer in slightly different ways:

`int()`and`floor()`— like`ceiling()`, but round down instead.`iPart()`— truncates a number to just its integer part (or, if you prefer, rounds a number toward 0).`round()`— rounds to a specific place value, not just to an integer, but`round(x,0)`will round x to the nearest integer, up or down.

`ceiling()` can also be applied to complex numbers, lists, and matrices, rounding everything that there is to round in each of them.

```
:ceiling(3)
3
:ceiling({-π,π})
{-3 4}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:ceiling

The char() Command

Returns a character given its ASCII code.

char(*code*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press D to enter the String submenu.
- Press A to paste char(.

This command works on all calculators.

2 bytes

The `char()` command converts an integer between 0 and 255 to the corresponding character in the calculator's internal code (which is a modification of ASCII). It can also operate on a list or matrix by converting each of their elements to a character.

This command, and its inverse `ord()`, can be useful for programs that deal with arbitrary strings (which could, potentially, contain any character), but they can come up in other cases as well. For example, since the letters A..Z are consecutive characters in the calculator's internal code, with A being `char(65)`, you can calculate the n^{th} letter in the alphabet with the expression `char(n+64)`.

There are two special values of `char()` to be aware of. The character given by `char(0)` is actually the empty string, which you usually want to avoid using; the character given by `char(13)` is a newline "enter" character, which is replaced by ":" when you type it somewhere. If you actually want to store `char(13)` to a string, you have to use the `char()` command.

# Advanced Uses

TI-Basic does not allow lists to contain picture variables, and in many cases (such as tilemaps) you want to get around this limitation. One way to do so is to name the variables "tile1", "tile2", "tile3", and so on, with only the number changing — then #("tile"&string(n)) gives the n^{th} picture variable.

A more efficient way is to assign the pictures numbers in a different range, such as 65-90, and name the variables "tilea", "tileb", "tilec", etc. Then, #("tile"&char(n)), which is faster, converts a number to the corresponding picture variable. This allows for a maximum of 146 different tiles, if you use all the characters that could conceivably be part of a variable name.

# Error Conditions

**260 - Domain error** happens when the character code isn't in the range 0..255.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:char

The checkTmr( Command

Returns the number of seconds since the timer was started.

checkTmr(*Variable*)

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- C to skip to command starting with C
- Scroll down to checkTmr( and select it

TI-84+/SE/CSE

2 bytes

The `checkTmr(` command is used together with the `startTmr` command to determine how much time has elapsed since the timer was started on the TI-84+/SE calculators. In particular, it returns the number of seconds since the built-in timer was started. An application of these commands is timing different commands or pieces of code, as well as countdowns in games, or a time-based score (such as in Minesweeper).

To use the timer, you first store `startTmr` to a variable (usually, a real variable) whenever you want the count to start. Now, whenever you want to check the elapsed time, you can use checkTmr( with the variable from above, giving you the number of seconds that have passed. Using `checkTmr(` doesn't stop the timer, you can do it as many times as you want to.

In the case of Minesweeper, for example, you would store `startTmr` to, for example, `T`, after setting up and displaying the board, display the result of `checkTmr(T)` in the game's key-reading loop, and store `checkTmr(T)` to the player's score if he wins.

# Advanced Uses

To time a command or routine using `startTmr` and `checkTmr(`, use the following template:

```
:ClockOn
:startTmr→T
:Repeat checkTmr(Ans
:End
:For(n,1,(number) //sequence variable n
(command(s) to be tested)
:End
:checkTmr(T+1)/(number)
```

Making (number) higher increases accuracy, but takes longer. Also, make sure not to modify the variables ` n` or

`T`inside the

`For(`loop.

While this method eliminates human error from counting, it's prone to its own faults. For example, `startTmr` and `checkTmr(` always return the time rounded down to a whole second. To take this into account, replace the last line:

`:(checkTmr(T+{1,0})/(number)`

When testing code, be aware that many different things affect the time: the strength of the batteries, the amount of free RAM, and including the closing parenthesis on the For( loop. The last one, in particular, has an impact when using a single-line `If` statement or one of the `IS>(` and `DS<(` commands on the first line inside a For( loop.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/checktmr

The checkTmr() Command

Checks the value of the system clock.

checkTmr(*time*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command requires a calculator with AMS version 2.07 or higher (it will also work on any TI-89 Titanium or Voyage 200 calculator)

2 bytes

The `checkTmr()` command, together with `startTmr()` uses the built-in system clock to measure the time (in seconds) that passed between two points of the program. Make sure that the clock is on (with `ClockOn` before using these).

The name of the commands reflects their use: you can think of a `startTmr()` call as creating and starting a timer:

`:startTmr()→timer`

The `checkTmr()` command will then return the number of seconds that have elapsed on the timer (without stopping it):

`:Disp "Seconds elapsed:",checkTmr(timer)`

This is a good abstraction and you don't need to know the details of how `startTmr()` and `checkTmr()` work to use them. In reality, what `startTmr()` actually returns is the current value of a system timer (which increases by 1 every second). The `checkTmr()` command does the same thing, but subtracts its parameter: so `checkTmr(x)` is equivalent to `startTmr()`-x.

Because both `startTmr()` and `checkTmr()` deal with whole numbers of seconds, the resulting difference in time could be off by up to a second in either direction. That is, if `checkTmr()` gives 15 seconds as the time, you know the time that actually passed is between 14 and 16 seconds.

# Advanced Uses

The `startTmr()` and `checkTmr()` commands can be used to figure out how much time a command or routine takes with much greater precisions by running it multiple times. For example:

```
:startTmr()→t
:For i,1,1000
: somecmd()
:Disp checkTmr(t)
```

Suppose that the result displayed was 100 seconds. This is accurate to 1 second, so the actual time was between 99 and 101 seconds. However, this actual time is for 1000 repetitions of

`somecmd()`(we assume that the time the code takes to increment i is negligible, although that may also be taken into account). So

`somecmd()`repeated only once takes between 99/1000 and 101/1000 seconds, so the actual time is 100 ms, measured to within 1 millisecond error.

See Code Timings for more information on this, as well as the results of some common comparisons.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:checktmr

The Circle( Command

Draws a circle.

Circle(*X*,*Y*,*r*)

(83+ and higher only)

Circle(*X*,*Y*,*r*,{*i*})

(84+ CSE only)

Circle(*X*,*Y*,*r*

Press:

- Press [2ND] [PRGM] to enter the DRAW menu
- Press [9] to insert Circle(

TI-83/84/+/SE

1 byte

`Circle( X,Y,r)` will draw a circle at (

*X*,

*Y*) with radius

*r*.

*X*and

*Y*will be affected by the window settings. The radius will also be affected by the window settings.

`:Circle(5,5,5)`

# Advanced Uses

The radius of a circle is affected by the window settings. This means that if the x- and y-increment is two, the radius will be two pixels. However, there is another way to take advantage of this to draw ellipses. If the x- and y-increment are different, then the shape will not be a circle. For instance, with Xmin=0, Xmax=20, Ymin=0, and Ymax=31, `Circle(10,10,2)` will draw an ellipse, where the width is greater than the height.

# Optimization

If a complex list such as {*i*} is passed to `Circle(` as the fourth argument, the "fast circle" routine is used instead, which uses the symmetries of the circle to only do 1/8 of the trig calculations. For example:

```
:Circle(0,0,5
can be
:Circle(0,0,5,{i
```

Any list of complex numbers will work as the fourth argument in the same way, but there's no benefit to using any other list.

Note: The "fast circle" routine is not available on the TI-84+CSE or TI-84+CE calculators.

# Command Timings

The ordinary `Circle(` is extremely slow. The fast circle trick discussed above cuts the time down to only about 30% of the "slow `Circle(`" time! While still not instant, this is faster than any replacement routine that can be written in TI-Basic.

For small radii, replace `Circle(` with `Pt-On(` instead.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/circle

The CLASSIC Command

Mode command that puts the calculator into Classic mode.

CLASSIC

Press:

- MODE
- DOWN until you reach MathPrint or Classic
- ENTER on Classic

Alternatively, use the catalog.

TI-84 2.53MP only

2 bytes

`CLASSIC` will put the calculator into `Classic` mode as opposed to `MathPrint` mode. The `Classic` mode will make the calculator display everything as pre-`MathPrint` OS would, including input. For instance, rather than superscripting exponents as `MathPrint` mode would, `Classic` mode uses the simple caret syntax (`^`).

*MathPrint mode*:

2^{4}

16

*Classic mode*:

2^4

16

# Advanced Uses

When in `Classic` mode, text and numbers are displayed much faster on the home screen and the function menus load faster. This can be useful in games that use the home screen, or just with calculations in general.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/classic-mode

The Clear Entries Command

Clears the history of commands previously entered on the homescreen.

Clear Entries

Press:

- 2nd MEM to access the memory menu.
- 3 to select Clear Entries, or use arrows and ENTER.

TI-83/84/+/SE

2 bytes

Normally, by pressing 2nd ENTER repeatedly, you can cycle through some of the recent entries on the home screen. With the `Clear Entries` command, this history is cleared (only `Clear Entries` remains in the history).

This can be used to free some memory, although it's recommended not to do this in a program (because clearing things without asking first isn't nice). Aside from that, maybe the only reason to use `Clear Entries` is to protect your privacy — although someone looking at your entries will know you cleared something, so it's not that effective.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clear-entries

The ClockOff Command

Turns off the clock display in the mode screen.

ClockOff

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- C to skip to command starting with C
- Scroll down to ClockOff and select it

TI-84+/SE

2 bytes

The `ClockOff` command turns off the clock display at the bottom of the mode screen on the TI-84+/SE calculators. You can turn the clock back on by using the `ClockOn` command, or by selecting 'TURN CLOCK ON' ,displayed in place of the clock on the mode screen.

The `ClockOff` command does not actually turn the clock off. The time can still be accessed through use of the `getTime` and `getDate` commands, and all their cousins.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clockoff

The ClockOff Command

Turns off the hardware clock.

ClockOff

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command requires a calculator with AMS version 2.07 or higher (it will also work on any TI-89 Titanium or Voyage 200 calculator)

2 bytes

The `ClockOff` Command turns off the calculator's clock as far as the time and date commands are concerned: that is, the timer used by `startTmr()`, `getTime()`, and other commands will not keep updating every second, but will stay the same until the clock is turned on again.

It's not usually a good idea to use this in a program: there's no real benefit to doing so (it doesn't make the calculator run faster or anything like that) but there's the real drawback that it throws off the calculator's time. However, the mere existence of this command means that you should probably use `ClockOn` anytime you need to use the time and date commands.

Since it modifies the global status of the calculator, `ClockOff` can't be used in a function.

# Error Conditions

**450 - Invalid in a function or current expression** happens when `ClockOff` is used inside a function.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:clockoff

The ClockOn Command

Turns on the clock display in the mode screen.

ClockOn

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- C to skip to command starting with C
- Scroll down to ClockOn and select it

TI-84+/SE

2 bytes

The `ClockOn` command turns on the clock display at the bottom of the mode screen on the TI-84+/SE calculators. Alternatively, you can scroll down to the 'TURN CLOCK ON' message that is displayed in place of the clock on the mode screen and press ENTER twice. You can turn the clock off by using the `ClockOff` command.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clockon

The ClockOn Command

Turns on the hardware clock.

ClockOn

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command requires a calculator with AMS version 2.07 or higher (it will also work on any TI-89 Titanium or Voyage 200 calculator)

2 bytes

The `ClockOn` command turns on the calculator's clock, used by most time and date commands. Only when the clock is on, will the value returned by `startTmr()`, `getTime()`, and other commands actually change with the passage of time. If you write a program that uses any of these commands, be sure to include this command at the beginning of the program.

Since it modifies the global status of the calculator, `ClockOn` can't be used inside a function. If you're writing a function that depends on measuring time (so you need the clock to be on), the best thing you can do is use the `isClkOn()` command to check if the clock is on or off, and return an error message if it's off.

# Error Conditions

**450 - Invalid in a function or current expression** happens when `ClockOn` is used in a function.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:clockon

The ClrAllLists Command

Sets the size of all defined lists to 0 (equivalent to applying the ClrList command to all defined lists).

ClrAllLists

Press:

- 2nd MEM to access the Memory menu
- 4 to select ClrAllLists, or use arrows

TI-83/84/+/SE

2 bytes

The `ClrAllLists` command sets the dimension (length) of all lists to zero. This is virtually equivalent to deleting the lists, except for two differences:

- The lists still exist and will show up in the list menu and the memory management menu.
- The
`dim(`command will return 0 for a cleared list, rather than an error.

However, accessing a cleared list in any other way will return an error, just as for a deleted list.

The `ClrAllLists` command should **never** be used in a program you give to someone else or upload - unless the user is aware of this effect, they might lose important data stored in one of their lists. There is no way to limit the effect of `ClrAllLists`, so a program should use `ClrList` instead to avoid affecting unrelated lists (this is assuming you already want to use this questionably-useful effect).

Outside a program (or in a program for personal use), you might use this command to clear the contents of your lists to free up memory, while still not deleting the lists. This might possibly be convenient. Maybe.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clralllists

The ClrDraw Command

Clears the graph screen, redrawing functions, plots, and axes/grid/labels, if applicable.

ClrDraw

Press:

- 2nd PRGM to enter the DRAW menu
- 1 or ENTER to select ClrDraw

TI-83/84/+/SE

1 byte

The `ClrDraw` command is useful clearing away something drawn on the graph screen; in particular, you want to do this at the beginning of a program that uses the graph screen, to get rid of anything that might be on it initially. If there are functions, plots, axes, labels, or grid enabled, these will be redrawn even after you `ClrDraw`. If you don't want these, you should turn them off before the `ClrDraw` command.

Like many other drawing commands, if you're outside a program and on the graph screen, you can use this command directly, without going to the home screen. Just select `ClrDraw` from the menu, and the screen will be cleared immediately.

# Advanced Uses

Unless the final state of the graph screen is the intended effect of the program, you want to use `ClrDraw` at the end of the program so that the user doesn't have to deal with it.

Caution: if the graph screen is displayed even before you execute `ClrDraw`, the user variable Y will be reset to 0. This might be useful as a side effect, but it's more likely to turn out to be a nuisance if you were relying on Y to store something useful. Also, such a wacky effect might get removed in later OS versions^{1}, so it's a gamble relying on it to work for all users.

The `RecallPic` command does not erase what is previously on the graph screen when recalling a picture. Unless this is what you intend, use `ClrDraw` to erase the graph screen's old contents before recalling a picture.

# Optimization

The `ClrDraw` command is not the only way to clear the screen. If something changes about the state of the functions or plots plotted on the graph, about the window dimensions, or the axes, grid, and labels, the graph screen will be marked as 'dirty' by the calculator, and will be cleared the next time you display it.

Don't be too confident about relying on this however. For example, if you cleared `Y _{1}` before displaying the graph, and

`Y`previously contained something, the graph will be redrawn. However, if

_{1}`Y`never existed, then you haven't changed anything, and the graph will remain.

_{1}A lot of people choose their preferred window settings using the following two commands, which sets the window to X= -47..47, Y= -31..31:

`ZStandard:ZInteger`

Since this actually switches two window settings, at least one will be different from the previous settings, so the next time the graph screen is shown, it will be cleared without a `ClrDraw` command. There are other friendly window settings that you can use as well.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clrdraw

The ClrDraw Command

Clears the graph screen, redrawing any functions, plots, or axes/grid/labels.

ClrDraw

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The `ClrDraw` command clears away anything drawn on the graph screen — that is, the result of any of the graphics commands, except for `Graph` (which you can only clear with `ClrGraph`). It also leaves alone any functions or plots (which are disabled by `FnOff` and `PlotsOff`, respectively), as well as axes, labels, a grid, etc. (which can be disabled by the `setGraph()` command).

Be warned that it doesn't update the screen. For example, if you run the following program:

```
:circ()
:Prgm
:Circle 0,0,5
:ClrDraw
:EndPrgm
```

it will draw a circle and then end on the graph screen with the circle still drawn. The screen will actually update the next time you change something on the graph screen; you can also use

`DispG`to update it (although in the program above,

`DispHome`might be more appropriate).

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:clrdraw

The ClrHome Command

Clears the home screen of any text or numbers.

ClrHome

While editing a program, press:

- PRGM to enter the PRGM menu
- RIGHT to enter the I/O menu
- 8 to choose ClrHome, or use arrows

TI-83/84/+/SE

1 byte

There are numerous times in a program that you need a clear screen, so that you can display whatever text you want without it being interrupted. One place, in particular, is at the beginning of a program, since the previous program call(s) and any other text is typically still displayed on the screen. The simple `ClrHome` command is the command you use to clear the home screen.

When you use the `ClrHome`, it resets the cursor position to the top left corner of the home screen. This is what the `Disp` and `Pause` commands use as the reference for what line to display their text on, but it does not have any effect on `Output(`.

# Advanced Uses

You want to make sure to clear the home screen when exiting programs (at the end of a program). This ensures that the next program that the user runs will not have to deal with whatever text your program left behind. It also helps the user, because they will not have to manually clear the home screen by pressing the CLEAR key; you have already done it for them.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clrhome

The ClrHome Command

Clears the home screen.

ClrHome

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The `ClrHome` command clears the home screen — not the I/O screen where the result of commands like `Disp` or `Output` is displayed (you'd need `ClrIO` for that), but the screen where you run programs and evaluate expressions. This isn't usually something you want a program to clear, so this isn't a very exciting command.

It also has the drawback that the `ClrHome` command itself (or the program it's used in) is displayed on the home screen *after* it is cleared, so the end result is not a blank screen but something like what you see in the screenshot to the right.

Finally, `ClrHome` cannot be used inside a function, because functions aren't allowed to modify the state of the calculator.

# Error Conditions

**450 - Invalid in a function or current expression** happens when `ClrHome` is used inside a function.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:clrhome

The ClrList Command

Sets the dimension of a list or lists to 0.

ClrList *list1*, [*list2*, *list3*, …]

Press:

- STAT to access the statistics menu
- 4 to select ClrList, or use arrows.

TI-83/84/+/SE

1 byte

`ClrList` sets the length of a list (or several lists) to 0. This is virtually equivalent to deleting the list, except for several differences:

- The list still exists — it will be shown in the memory management menu and the list menu
- Calling the
`dim(`command on it will return 0, rather than an error. `ClrList`can clear multiple lists at the same time

# Advanced Uses

You might use `ClrList` when building up a list element by element and using `dim(` in the process:

```
:ClrList L1
:While 10>dim(L1
:Input X
:X→L1(1+dim(L1
:End
```

# Optimization

Using `DelVar` instead of `ClrList` allows you to save a tiny bit of memory (between 12 and 16 bytes) that `ClrList` doesn't delete, while keeping almost every aspect of the list clearing the same. If you are clearing several lists, you can separate them with commas as the arguments to `ClrList`, which can save space. Using `ClrList` is also substantially faster than `DelVar` if the list is going to be cleared many times.

# Error Conditions

**ERR:SYNTAX**is thrown if you leave off the ∟ symbol when referring to a custom list (i.e.,`ClrList`B will not work; you have to use`ClrList`∟B).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clrlist

The ClrTable Command

Clears saved calculations for the table screen.

ClrTable

While editing a program, press:

- PRGM to access the program menu.
- RIGHT to access the I/O submenu.
- 9 to select ClrTable.

TI-83/84/+/SE

1 byte

The `ClrTable` command clears all calculations for the table screen shown if you press 2nd TABLE. That is, all already-calculated values in the table are cleared, and TblInput is deleted. In `IndpntAuto` and `DependAuto` mode, this usually isn't noticeable because the table will be recalculated almost immediately when you next look at it (unless one of the entered functions is so complicated it takes a while to calculate). This mainly has an effect in `IndpntAsk` or `DependAsk` mode, where the corresponding parts of the table will be cleared entirely.

# Advanced Uses

As a side effect, `ClrTable` seems to have all the effects of `ClrDraw` — it clears the graph screen, and any equations or plots will be regraphed the next time the graph screen is displayed.

# Command Timings

`ClrTable` and `ClrDraw` take the same amount of time to clear the screen.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/clrtable

The conj( Command

Calculates the complex conjugate of a complex number.

conj(*value*)

Press:

- MATH to access the math menu.
- RIGHT, RIGHT to access the CPX (complex) submenu
- ENTER to select conj(.

TI-83/84/+/SE

2 bytes

`conj( z)` returns the complex conjugate of the complex number

*z*. If

*z*is represented as

*x*+i

*y*where

*x*and

*y*are both real,

`conj(`returns

*z*)*x*-i

*y*. Also works on a list of complex numbers.

```
conj(3+4i)
3-4i
```

The conjugate of a number $z$ is often written $\overline{z}$, and is useful because it has the property that $z\overline{z}$ and $z+\overline{z}$ are real numbers.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/conj

The Connected Command

Sets all equations to use the connected graphing style, and makes it the default setting.

Connected

Press:

- MODE to access the mode menu.
- Use arrows to select Connected.

TI-83/84/+/SE (Not available on TI-84+CE calculators)

2 bytes

The `Connected` command sets all equations to use the usual graph style - a connected line. In addition, this graph style is made the default, so that when a variable is deleted it will revert to this graph style. The other possible setting for this option is `Dot`.

Compare this to the `GraphStyle(` command, which puts a single equation into a specified graph style.

The `Connected` and `Dot` commands don't depend on graphing mode, and will always affect all functions, even in other graphing modes. The exception to this is that `sequence` mode's default is always the dotted-line style, even when `Connected` mode is set. The `Connected` command will still change their graphing style, it just won't change the default they revert to.

In addition to graphing equations, this setting also affects the output of `DrawF`, `DrawInv`, and `Tangent(`.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/connected

The CoordOff Command

Turns off the cursor coordinate display on the graph screen.

CoordOff

Press:

- 2nd FORMAT to access the graph format menu
- Use arrows and ENTER to select CoordOff

TI-83/84/+/SE

2 bytes

When moving a cursor on a screen, it's possible for the calculator to display the coordinates of the current point (either polar or rectangular coordinates, depending on which of `RectGC` or `PolarGC` is set). The `CoordOff` command turns off this option.

To turn it on, use the `CoordOn` command.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/coordoff

The CoordOn Command

Turns on the cursor coordinate display on the graph screen.

CoordOn

Press:

- 2nd FORMAT to access the graph format menu
- Use arrows and ENTER to select CoordOn

TI-83/84/+/SE

2 bytes

When moving a cursor on a screen, it's possible for the calculator to display the coordinates of the current point (either polar or rectangular coordinates, depending on which of `RectGC` or `PolarGC` is set). The `CoordOn` command turns on this option (to disable it, use the `CoordOff` command).

The coordinates are displayed in practically every situation when you're moving a cursor on the graph screen, even including the `Trace`, `Input` or `Select(` commands in a program. The interactive mode of `Text(` and the `Pen` tool are the exceptions — this is because these two situations involve a pixel coordinate, and not a point.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/coordon

The cos( Command

`cos(θ)` returns the cosine of θ, which is defined as the x-value of the point of intersection of the unit circle and a line containing the origin that makes an angle θ with the positive x-axis

The value returned depends on whether the calculator is in `Radian` or `Degree` mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The `cos(` command also works on a list of real numbers.

In radians:

```
cos(π/3)
.5
```

In degrees:

```
cos(60)
.5
```

# Advanced Uses

You can bypass the mode setting by using the `°` (degree) and ` ^{r}` (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians:

```
cos(60°)
.5
```

```
cos(π/3^r)
.5
```

# Error Conditions

**ERR:DATA TYPE**is thrown if you supply a matrix or a complex argument.**ERR:ARGUMENT**is thrown if you use more than one number.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/cos

The cos() Command

Takes the cosine of a number (usually, an angle).

cos(*angle*)

**Menu Location**

Press the COS button to enter cos(.

This command works on all calculators.

1 byte

The `cos()` command returns the cosine of an angle measure. Naturally, the result depends on the angle mode the calculator is in: radian, degree, or (in AMS version 3.10) gradian. You can also use one of the ^{r}, `°`, ^{G} marks to specify an angle mode.

For many common angles, `cos()` can compute an exact result. Other angles, the calculator will leave alone unless it's in approximate mode (or unless you make it approximate), and then it will give a decimal approximation. As long as the calculator is in radian mode, `cos()` can be used with complex numbers as well.

```
:cos(60°)
1/2
:cos(x+2π)
cos(x)
:cos(πi/2)
cosh(π/2)
```

If `cos()` is applied to a list, it will take the cosine of every element in the list.

# Advanced Uses

The `cos()` of a matrix is not (in general) the same as taking the cosine of every element of the matrix. A different definition is used to compute the result; see Matrices and Their Commands. It requires the matrix to be square and diagonalizable in order to apply.

# Error Conditions

**230 - Dimension** happens when taking `cos()` of a matrix that isn't square.

**260 - Domain error** happens when taking `cos()` of a complex number in degree or gradian mode.

**665 - Matrix not diagonalizable** happens when taking `cos()` of a matrix that isn't diagonalizable.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:cos

The cosֿ¹( Command

Returns the inverse cosine (also called arccosine)

cosֿ¹(*number*)

Press:

- [2nd]
- [cosֿ¹]

TI-83/84/+/SE

1 byte

`cosֿ¹(` returns the arccosine of its argument. It is the inverse of `cos(`, which means that `cosֿ¹(n)` produces an angle θ such that `cos(θ)`=n.

Like `cos(`, the result of `cosֿ¹(` depends on whether the calculator is in Radian or Degree mode. However, unlike cosine, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=`cosֿ¹(n)` from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The `cosֿ¹(` command also works on a list.

The `cosֿ¹(` function can be defined for all real and complex numbers, but assumes real values only in the closed interval [-1,1]. Because Z80 calculators have their trigonometric functions and inverses restricted only to real values, the calculator will throw ERR:DOMAIN if the argument is outside of this interval, no matter what the mode setting may be.

In radians:

```
:cosֿ¹(-1)
3.141592654
```

In degrees:

```
:cosֿ¹(-1)
180
```

# Advanced Uses

Since the function cosine itself doesn't have the restrictions that arccosine does, and since arccosine is the inverse of cosine, you can use `cosֿ¹(cos(` to keep a variable within a certain range (most useful for the home screen). Here is an example for a game like pong. The ball travels between 0 and 12.

You could use a flag like this:

```
:If X=12 or not(X \\ X is the position
:-D→D \\ D is the direction
:X+D→X \\ new position
:Output(8,X,"=
```

An easier way to do this, without needing a flag or even an `If` statement, is using `cosֿ¹(cos(`

```
:X+1→X \\ Note: the calculator is in Degree mode
:Output(8,cosֿ¹(cos(15X))/15,"=") \\ I used 15 because cosֿ¹ ranges from [0,180]
and X from [0,12], so 180/12=15
```

# Error Conditions

**ERR:DOMAIN**is thrown if you supplied an argument outside the interval [-1,1]**ERR:DATA TYPE**is thrown if you input a complex value or a matrix.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/arccos

The cosh( Command

Calculates the hyperbolic cosine of a value.

cosh(*value*)

The cosh( command is only found in the Catalog. Press:

- 2nd CATALOG to access the command catalog.
- C to skip to commands starting with C.
- Scroll down and select cosh(.

TI-83/84/+/SE

1 byte

Calculates the hyperbolic cosine of a value. The hyperbolic trig functions `sinh(`, `cosh(`, and `tanh(` are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of `e`, and don't depend on the Degree or Radian mode setting.

```
cosh(0)
1
cosh(1)
1.543080635
```

Like normal trig commands, `cosh(` works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics.

# Formulas

The definition of hyperbolic cosine is:

(1)# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/cosh

The cosh() Command

Takes the hyperbolic cosine of a number.

cosh(*value*)

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press C to enter the Hyperbolic submenu.
- Press 2 to select cosh(.

This command works on all calculators.

1 byte

The `cosh()` command returns the hyperbolic cosine of a number.

As long as the calculator is in radian mode, `cosh()` can be used with complex numbers according to the rule that cosh(** i**x)=cos(x) and cos(

**x)=cosh(x). This rule only works in radian mode, and**

*i*`cosh()`of a complex number will return a domain error when working in degrees or gradians.

Occasionally, `cosh()` can compute an exact result; most of the time, the calculator will leave an expression with `cosh()` alone unless it's in approximate mode (or you force an approximation). When `cosh()` is used with symbolic expressions, the calculator can go back and forth between the `cosh()` expression and its exponential equivalent.

```
:cosh(0)
1
:expand(cosh(x))
e^x/2+1/(2*e^x)
:comDenom(e^x/2+1/(2*e^x))
cosh(x)
```

If `cosh()` is applied to a list, it will take the hyperbolic cosine of every element in the list.

# Advanced Uses

The `cosh()` of a matrix is not (in general) the same as taking the hyperbolic cosine of every element of the matrix. A different definition is used to compute the result; see Matrices and Their Commands. It requires the matrix to be square and diagonalizable in order to apply.

# Formulas

The definition of hyperbolic cosine is given in terms of exponents:

(1)# Error Conditions

**230 - Dimension** happens when taking `cosh()` of a matrix that isn't square.

**260 - Domain error** happens when taking `cosh()` of a complex number in degree or gradian mode.

**665 - Matrix not diagonalizable** happens when taking `cosh()` of a matrix that isn't diagonalizable.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:cosh

The coshֿ¹( Command

Calculates the inverse hyperbolic cosine of a value.

coshֿ¹(*value*)

The coshֿ¹( command can only be found in the catalog. Press:

- 2nd CATALOG to access the command catalog.
- C to skip to commands starting with C.
- Scroll down and select coshֿ¹(

TI-83/84/+/SE

1 byte

The `coshֿ¹(` function gives the inverse hyperbolic cosine of a value. `coshֿ¹(x)` is the number y such that x = `cosh(y)`.

Although `coshֿ¹(x)` can be defined for all real and complex numbers, it assumes real values only for x≥1. Since hyperbolic functions in the Z80 calculators are restricted only to real values, ERR:DOMAIN is thrown when x<1.

The `coshֿ¹(` command also works for lists.

```
coshֿ¹(1)
0
coshֿ¹({2,3})
{1.316957897 1.762747174}
```

# Error Conditions

**ERR:DOMAIN**when taking the inverse cosh of a number less than 1.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/arcosh

The cot() Command

Takes the cotangent of a number (usually, an angle).

cot(*angle*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press A to enter the Trig submenu.
- Press 6 to select cot(.

1 byte

The `cot()` command returns the cotangent (the reciprocal of the `tangent`) of an angle measure. Naturally, the result depends on the angle mode the calculator is in: radian, degree, or (in AMS version 3.10) gradian. You can also use one of the ` ^{r}`,

`°`,

`marks to specify an angle mode.`

^{G}The `cot()` command, along with 11 other trig and hyperbolic functions, was added with AMS version 2.07. It can be easily replaced on earlier versions with `1/tan(x)`, which is what it simplifies to anyway.

For many common angles, `cot()` can compute an exact result. Other angles, the calculator will leave alone unless it's in approximate mode (or unless you make it approximate), and then it will give a decimal approximation. As long as the calculator is in radian mode, `cot()` can be used with complex numbers as well.

```
:cot(60°)
√3/3
:cot(x)
1/tan(x)
:cot(0)
undef
```

If `cot()` is applied to a list, it will take the cotangent of every element in the list. However, it can't be applied to matrices the way `cos()` can (this is probably an oversight; all the trig and hyperbolic functions that were present in all AMS versions work with matrices, but the ones added in version 2.07 do not).

# Error Conditions

**260 - Domain error** happens when taking `cot()` of a complex number in degree or gradian mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:cot

The coth() Command

Takes the hyperbolic cotangent of a number.

coth(*value*)

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press C to enter the Hyperbolic submenu.
- Press 6 to select coth(.

1 byte

The `coth()` command returns the hyperbolic cotangent of a number. Along with 11 other trig and hyperbolic functions, it was added in AMS version 2.07; on earlier versions, `coth(x)` can be replaced by 1/`tanh(x)`.

As long as the calculator is in radian mode, coth() can be used with complex numbers according to the rule that coth(** i**x)=-cot(x)

*****and cot(

*i***x)=-coth(x)**

*i******. This rule only works in radian mode, and

*i*`coth()`of a complex number will return a domain error when working in degrees or gradians.

Occasionally, `coth()` can compute an exact result; most of the time, the calculator will leave an expression with `coth()` alone unless it's in approximate mode (or you force an approximation). When `coth()` is used with symbolic expressions, the calculator can go back and forth between the `coth()` expression and its exponential equivalent.

```
:coth(0)
undef
:expand(coth(x))
-1/(e^x+1)+1/(e^x-1)+1
:comDenom(1-2/((e^x)^2+1))
1/tanh(x)
```

If `coth()` is applied to a list, it will take the hyperbolic cotangent of every element in the list. However, it can't be applied to matrices the way `tanh()` can (this is probably an oversight; all the trig and hyperbolic functions that were present in all AMS versions work with matrices, but the ones added in version 2.07 do not).

# Formulas

The definition of hyperbolic cotangent is, by analogy with `cot()`, the ratio of `cosh()` and `sinh()`:

# Error Conditions

**260 - Domain error** happens when taking `coth()` of a complex number in degree or gradian mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:coth

The csc() Command

Takes the cosecant of a number (usually, an angle).

csc(*angle*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press A to enter the Trig submenu.
- Press 4 to select csc(.

1 byte

The `csc()` command returns the cosecant (the reciprocal of the `sine`) of an angle measure. Naturally, the result depends on the angle mode the calculator is in: radian, degree, or (in AMS version 3.10) gradian. You can also use one of the ` ^{r}`,

`°`,

`marks to specify an angle mode.`

^{G}The `csc()` command, along with 11 other trig and hyperbolic functions, was added with AMS version 2.07. It can be easily replaced on earlier versions with 1/sin(x), which is what it simplifies to anyway.

For many common angles, `csc()` can compute an exact result. Other angles, the calculator will leave alone unless it's in approximate mode (or unless you make it approximate), and then it will give a decimal approximation. As long as the calculator is in radian mode, `csc()` can be used with complex numbers as well.

```
:csc(30°)
2
:csc(x)
1/sin(x)
:csc(0)
undef
```

If `csc()` is applied to a list, it will take the secant of every element in the list. However, it can't be applied to matrices the way `sin()` can (this is probably an oversight; all the trig and hyperbolic functions that were present in all AMS versions work with matrices, but the ones added in version 2.07 do not).

# Error Conditions

**260 - Domain error** happens when taking `csc()` of a complex number in degree or gradian mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:csc

The csch() Command

Takes the hyperbolic cosecant of a number.

csch(*value*)

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press C to enter the Hyperbolic submenu.
- Press 4 to select csch(.

1 byte

The `csch()` command returns the hyperbolic cosecant of a number. Along with 11 other trig and hyperbolic functions, it was added in AMS version 2.07; on earlier versions, `csch(x)` can be replaced by 1/`sinh(x)`.

As long as the calculator is in radian mode, `csch()` can be used with complex numbers according to the rule that csch(** i**x)=-csc(x)

*****and csc(

*i***x)=-csch(x)**

*i******. This rule only works in radian mode, and

*i*`csch()`of a complex number will return a domain error when working in degrees or gradians.

Occasionally, `csch()` can compute an exact result; most of the time, the calculator will leave an expression with `csch()` alone unless it's in approximate mode (or you force an approximation). When `csch()` is used with symbolic expressions, the calculator can go back and forth between the `csch()` expression and its exponential equivalent.

```
:csch(0)
undef
:expand(csch(x))
1/(e^x+1)+1/(e^x-1)
:comDenom(1/(e^x+1)+1/(e^x-1))
1/sinh(x)
```

If `csch()` is applied to a list, it will take the hyperbolic cosecant of every element in the list. However, it can't be applied to matrices the way `sinh()` can (this is probably an oversight; all the trig and hyperbolic functions that were present in all AMS versions work with matrices, but the ones added in version 2.07 do not).

# Formulas

The definition of hyperbolic cosecant is, by analogy with `csc()`, the reciprocal of `sinh()`:

# Error Conditions

**260 - Domain error** happens when taking `csch()` of a complex number in degree or gradian mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:csch

The CubicReg Command

Calculates the best fit cubic function through a set of points.

CubicReg [*x-list*, *y-list*, [*frequency list*], [*equation variable*]

Press:

- [STAT] to access the statistics menu
- [LEFT] to access the CALC submenu
- 6 to select CubicReg, or use arrows

TI-83/84/+/SE

1 byte

The `CubicReg` command can calculate the best fit cubic function through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. You must have at least 4 points because there are infinitely many cubics that can go through 3 points or less.

In its simplest form, `CubicReg` takes no arguments, and calculates a cubic through the points in L₁ and L₂:

```
:{9,13,21,30,31,31,34→L₁
:{260,320,420,530,560,550,590→L₂
:CubicReg
```

On the home screen, or as the last line of a program, this will display the equation of the quadratic: you'll be shown the format, y=ax³+bx²+cx+d, and the values of a, b, c, and d. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program — accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, c, d, and R² will be set as well. This latter variable will be displayed only if "Diagnostic Mode" is turned on (see `DiagnosticOn` and `DiagnosticOff`).

You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example:

```
:{9,13,21,30,31,31,34→FAT
:{260,320,420,530,560,550,590→CALS
:CubicReg ∟FAT,∟CALS
```

You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument — the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂.

Finally, you can enter an equation variable (such as Y₁) after the command, so that the equation is stored in this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the quadratic will be in terms of X anyway, this doesn't make much sense.

An example of `CubicReg` with all the optional arguments:

```
:{9,13,21,30,31,31,34→FAT
:{260,320,420,530,560,550,590→CALS
:{2,1,1,1,2,1,1→FREQ
:CubicReg ∟FAT,∟CALS,∟FREQ,Y₁
```

# Advanced

Note that even if a relationship is actually linear or quadratic, since a cubic regression has all the freedom of a linear regression and more, it will produce a better R² value, especially if the number of points is small, and may lead you to (falsely) believe that a relationship is cubic when it actually isn't. Take the correlation constant with a grain of salt, and consider if the fit is really that much better at the expense of doubling the complexity and if there's any reason to believe the relationship between the variables may be cubic.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/cubicreg

The cumSum( Command

Calculates cumulative sums of a list or of the columns of a matrix.

cumSum(*list or matrix*)

Press:

- 2nd LIST to access the list menu.
- RIGHT to access the OPS submenu.
- 6 to select cumSum(, or use arrows.

Alternatively, press:

- MATRIX (TI-83) or 2nd MATRIX (TI-83+ or higher) to access the matrix menu.
- RIGHT to access the MATH submenu.
- 0 to select cumSum(, or use arrows.

TI-83/84/+/SE

2 bytes

`cumSum(` calculates the cumulative sums of a list, or of the columns of a matrix, and outputs them in a new list or matrix variable.

For a list, this means that the Nth element of the result is the sum of the first N elements of the list:

```
cumSum({1,3,5,7,9})
{1 4 9 16 25}
```

For a matrix, `cumSum(` is applied to each column in the same way as it would be for a list (but numbers in different columns are never added):

```
[[0,1,1][0,1,3][0,1,5][0,1,7]]
[[0 1 1]
[0 1 3]
[0 1 5]
[0 1 7]]
cumSum(Ans)
[[0 1 1]
[0 2 4]
[0 3 9]
[0 4 16]]
```

# Advanced Uses

The `ΔList(` command is very nearly the inverse of the cumSum( command - it calculates the differences between consecutive elements. For any list, `ΔList(cumSum( list))` will return the same list, but without its first element:

```
ΔList(cumSum({1,2,3,4,5,6,7}))
{2 3 4 5 6 7}
```

Removing the first element would otherwise be a difficult procedure involving the `seq(` command, so this is a useful trick to know.

For a matrix, if you want to sum up the rows instead of the columns, use the ` ^{T}` (

`transpose`) command.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/cumsum

The Custom Command

Creates a custom toolbar menu.

:Custom

*(list of titles and items)*

:EndCustm

**Menu Location**

Starting in the program editor:

- Press F2 to enter the Control menu.
- Press 7 to select Custom…EndCustm.

This command works on all calculators.

2 bytes for Custom;

2 bytes for EndCustm.

A `Custom`..`EndCustm` block creates a custom toolbar menu. The menu can have up to eight tabs for the F1 .. F8 keys, each with any number of sub-items. The contents of the menu are defined using the `Title` and `Item` commands inside the `Custom`..`EndCustm` block.

The `Title` command indicates a new tab, so you can have up to eight of these. After `Title`, put a string to use as the label for the tab. If the title has no items, you'll be able to select the title itself to insert this label somewhere.

The `Item` command indicates an item under the most recent tab — you can have as many items under a tab as you like, or none at all. This also takes a string that will be used as the label for the item, *and* will be inserted any time you select that item from the menu.

Here is an example of the syntax:

```
:Custom
: Title "Animals"
: Item "Dog"
: Item "Cat"
: Title "Rocks"
: Title "Plants"
: Item "Grass"
: ...
:EndCustm
```

In this case, the custom toolbar will display | F1 Animals | F2 Rocks | F3 Plants | … |. Pressing F1 would bring up the Animals menu with items 1:Dog and 2:Cat. Then, pressing 1 or ENTER would insert Dog after the cursor. Pressing F2 would insert Rocks under the cursor since that tab has no items.

The custom toolbar can be accessed in any window. To switch to the custom toolbar or back, press 2nd CUSTOM (or use the `CustmOn` and `CustmOff` commands).

The calculator comes with a default custom menu, which is overwritten whenever you create one of your own. To restore it, select F6 - Clean Up from the home screen toolbar, and select 3:Restore custom default. This also lets you see an example of `Custom`..`EndCustm` syntax.

A related command is `Toolbar`..`EndTBar`. It also displays a custom menu, but can only be used in a program, and the entries of the menu jump to other parts of the program.

# Error Conditions

**450 - Invalid in a function or current expression** happens when `Custom`..`EndCustm` is used in a function.

**460 - Invalid in {{Custom}}..{{EndCustm}} block** happens when anything other than `Title` or `Item` appears in the block.

**590 - Invalid syntax block** happens when the syntax is somehow wrong, e.g. if there are more than 8 tabs.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:custom

The Cycle Command

Prematurely ends a cycle of a loop.

:Cycle

**Menu Location**

Starting in the program editor:

- Press F2 to enter the Control menu.
- Press 8 to enter the Transfers submenu.
- Press 3 to select Cycle.

This command works on all calculators.

4 bytes

The `Cycle` command ends the current cycle of a `For`..`EndFor`, `Loop`..`EndLoop`, or `While`..`EndWhile` loop, as though the corresponding `End` were there. It doesn't exit the loop forever; if the loop would have repeated, it goes back to the beginning. However, if the loop is ready to end (if the counter is equal to the end value, for a `For` loop, or if the condition is false, for a `While` loop), it exits the loop and continues after the `EndFor` or `EndWhile` command.

An example of `Cycle` in a `For` loop:

```
:For num,1,100
: If isPrime(num)
: Cycle
: Disp num
:EndFor
```

This loop prints all the composite numbers between 1 and 100. Here's how it works: for every number, it first checks whether or not it's prime. If it is, the program goes back to the beginning of the loop with the next number. On the other hand, if the number is composite, the program continues to the `Disp` command, then hits `EndFor` and goes back to the beginning of the loop as well.

If the `Cycle` instruction is inside multiple loops, one nested in the other, it works with the innermost loop.

# Error Conditions

**560 - Invalid outside Loop..EndLoop, For..EndFor, or While..EndWhile blocks** happens when `Cycle` is used outside a loop.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:cycle

The CyclePic command

Displays picture variables in a cycle for a given amount of time per picture.

CyclePic *picNameString*, *number of pictures* *[[,wait][,cycles][,direction]]*

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

This command displays several picture variables in a cycle, with each picture getting an optional wait time, number of cycles, and the direction to display the pictures in. For instance, if you have saved 5 pictures: pic1, pic2, pic3, pic4, pic5, then you could do this to display them all: `CyclePic` "pic", 5, 3, 2, -1. This would display all 5 pictures for 3 seconds each, for 2 cycles, and backward, meaning it would display picture 5 first…

`:CyclePic "ham", 3, 1.5, 6, 1`

The above code would display pictures "ham1", "ham2", and "ham3" in that order for 1.5 seconds each, and for 6 cycles.

# Advanced Uses

This command can be used to create a handy slideshow style program, or it can be used to display a sprite so it looks like it is moving.

# Error Conditions

**960 - Undefined variable** happens when the picture variables specified do not exist..

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:cyclepic

The d() Command

Takes a symbolic derivative of an expression.

*d*(*expression*,*variable*[,*order*])

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press B to enter the Calculus submenu.
- Press 1 to select
*d*(.

This command works on all calculators.

2 bytes

NOTE: Due to the limitations of the wiki markup language, thed() command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information.

The ` d()` command takes the derivative of an expression with respect to a given variable. All other variables are treated as constant.

Optionally, you can give it a third argument (an integer), and take the derivative that many times. If the argument is negative, it will actually integrate.

```
:d(x^2,x)
2*x
:d(x^5,x,4)
120*x
:d(x^2+y^2+2*x*y,x)
2*x+2*y
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:d

The dayOfWk command

Returns an integer from 1-7 that shows what day of week it is for a specific date.

dayOfWk(*year, month, day*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

The `dayOfWk` command returns an integer from 1 through 7 which shows what day of the week it was on a certain date. The Ti-89 Titanium manual says that this function may not give accurate results for years prior to 1583 (pre-Gregorian calendar).

Integer value: | Day of the week: |
---|---|

1 | Sunday |

2 | Monday |

3 | Tuesday |

4 | Wednesday |

5 | Thursday |

6 | Friday |

7 | Saturday |

```
:dayOfWk(1948,9,6)
: 2
:dayOfWk(1600,1,15)
: 7
```

The above examples find that September 6^{th},1948 was a Monday and that January 15^{th}, 1600 was a Saturday. It also works with future dates, in case you want to use that in a program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dayofwk

The dayOfWk( Command

Returns an integer from 1 to 7, each representing a day of the week, given a date.

dayOfWk(*year*,*month*,*day*)

Press:

- [2ND] + [0] for the CATALOG
- [X
^{-1}] to jump to the letter D - [ENTER] to insert the command

TI-84+/SE

2 bytes

`dayOfWk( year,month,day)` returns an integer from 1 to 7, each representing a separate day of the week. 1 represents Sunday, 2 represents Monday, and so on, with 7 representing Saturday. The date format is different than the normal American format (month/day/year), so be careful to put the arguments in the right order. You can remember this by thinking of the descending lengths of time in each of the arguments.

`:dayOfWk(2007,12,30)`

The above code returns 1, because the 30

^{th}of December, 2007, is a Sunday.

# Error Conditions

**ERR:DOMAIN**is thrown if any of the arguments are non-integers, or the date does not exist, such as the 42^{nd}of February. However, the year does not matter (a date that takes place in the year 10000 is valid). However, there are exceptions, even if some dates do exist, this error may still occur. If you attempt to calculate the previous day of a week such as the previous day, the error may still occur.

# Related Commands

# See Also

- Day of Week — routine to calculate the day of the week

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dayofwk

The dbd( Command

Calculates the number of days between two days.

dbd(*date1*, *date2*)

Date format — one of:

- DDMM.YY
- MM.DDYY

On the TI-83, press:

- 2nd FINANCE to access the finance menu.
- ALPHA D to select dbd(, or use arrows and ENTER.

On the TI-83+ or higher, press:

- APPS to access the applications menu.
- ENTER to select Finance…
- ALPHA D to select dbd(, or use arrows and ENTER.

TI-83/84/+/SE

2 bytes

The `dbd(` command calculates the number of days between two dates. Each date is encoded as a single number in one of two formats (two formats can be mixed in the same command):

- day, month, year — DDMM.YY (e.g. April 26, 1989 would be 2604.89)
- month, day, year — MM.DDYY (e.g. April 26, 1989 would be 04.2689 or just 4.2689)

Because this is just a number like any other, leading zeroes and trailing zeroes after the decimal can be dropped. For example, January 1, 2000 does not have to be formatted as 0101.00 but can be simply 101.

Since there are only two digits for the year, obviously only a century's worth of dates can be handled. The calculator assumes this range to be from January 1, 1950 to December 31, 2049.

If the second date comes before the first, `dbd(` will return a negative number of days, so the range of possible results is from -36524 to 36524.

Finally, `dbd(` will also work for list inputs in the usual manner: a single date will be compared against every date in a list, and two lists of dates will be paired up.

```
dbd(612.07,2512.07
19
dbd(1.0207,1.0107
-1
dbd(1.0107,{2.0107,3.0107,4.0107})
{31 59 90}
```

# Advanced Uses

The `dbd(` command can be used to calculate the day of week without using the `dayOfWk(` command, which is only available on the TI-84+ or higher.

# Error Conditions

**ERR:DOMAIN**is thrown if a date is improperly formatted.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dbd

The DEC Answer Command

Mode command that sets Answers to DEC.

DEC Answer

Press:

- MODE
- DOWN until you see Answers
- ENTER on DEC

Alternatively, access the catalog.

TI-84 2.53MP only

2 bytes

The `DEC Answer` command is a mode command that changes the Answers mode to DEC. DEC mode is very similar to the AUTO mode in which the calculator will display all answers in decimal form unless the returned number is an integer. Fractions will only be displayed with use of the `►Frac` command.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dec-answer

The ►Dec Command

Displays the decimal form of a fraction.

*<fraction>*►Dec

While editing a program, press:

- MATH to enter the MATH menu
- 2 or use the arrow keys to select

TI-83/84/+/SE

1 byte

This command is generally useless. Its supposed use is to convert numbers into decimal form, but any typed fractions are displayed as decimals anyway.

```
1/3
.3333333333
1/3►Dec
.3333333333
```

In 2.53 MP or higher, typed fractions are displayed in fraction form. Therefore, the `►Dec` command is useful in this case.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dec

The Define Command

Stores a value in a variable.

Define *variable*=*value*

**Menu Location**

Starting in the program editor:

- Press F4 to enter the Var menu.
- Press 1 or Enter to select Define.

This command works on all calculators.

2 bytes

The `Define` command sets the value of a variable. At its simplest, it's an alternative to `→`: `Define` x=5 is equivalent to 5→x. However, `Define` is also useful for defining functions or programs using `Func`..`EndFunc` or `Prgm`..`EndPrgm` respectively, which `→` can't do:

```
:Define key()=Func
: Local k
: Loop
: getKey()→k
: If k≠0
: Return k
: EndLoop
:EndFunc
```

# Advanced Uses

Using `Define` to create functions or programs is very useful when inside a program. If your program uses its own subroutines to perform simple tasks (such as the key-reading program above), you can define these subroutines inside the program itself, keeping everything in one file (it might be good to make them `Local` or use `DelVar` to delete them afterwards). Subroutines are useful for organizing a large program.

# Error Conditions

**190 - Circular definition** happens when defining a variable (other than a recursive function or program) in terms of itself.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:define

The Degree Command

Puts the calculator in Degree mode.

Degree

While editing a program, press:

- MODE to access the mode menu.
- Use arrows and ENTER to select Degree.

TI-83/84/+/SE

1 byte

The `Degree` command puts the calculator into Degree mode, where the inputs and/or outputs to trig functions are assumed to be degree angles.

Angles measured in degrees range from 0 to 360, with 0 being an empty angle, 90 being a right angle, 180 being a straight angle, and 360 being a full angle all the way around a circle.

To convert from a radian angle to a degree angle, multiply by 180/π. To go the other way, and get a radian angle from a degree angle, multiply by π/180.

The following commands are affected by whether the calculator is in `Radian` or `Degree` mode:

The input is differently interpreted:

The output is differently expressed:

However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the `SinReg` command, which assumes that the calculator is in `Radian` mode even when it's not. As a result, the regression model it generates will graph incorrectly in `Degree` mode.

Also, complex numbers in polar form are an endless source of confusion. The `angle(` command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the `e^(` command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:

```
Degree:re^θi
Done
e^(πi)
1e^(180i)
Ans=e^(180i)
0 (false)
```

Overall, it's better to put your calculator in `Radian` mode when dealing with polar form of complex numbers, especially since no mathematician would ever use degrees for the purpose anyway.

# Optimization

It's sometimes beneficial to use the `°` symbol instead of switching to `Degree` mode. The ° symbol will make sure a number is interpreted as a degree angle, even in `Radian` mode, so that, for example:

```
Radian
Done
sin(90)
-.8011526357
sin(90°)
1
```

This is smaller when only one trig calculation needs to be done. Also, it doesn't change the user's settings, which are good to preserve whenever possible.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/degree-mode

The DelVar Command

Deletes a variable from memory.

DelVar *variable*

While editing a program, press:

- PRGM to enter the PRGM menu
- ALPHA TAN to choose DelVar, or use arrows

TI-83/84/+/SE

2 bytes

The `DelVar` command deletes the contents of a variable (and thus the variable itself) from memory. You can use the `DelVar` command with any variable: reals, lists, matrices, strings, pictures, etc. However, you cannot use `DelVar` on specific elements of a matrix or string; it will actually throw a ERR:SYNTAX error. (It also does not work on programs, unfortunately.)

If the `DelVar` command is used with a real variable, the variable is not only deleted from memory but automatically set to zero the next time it is used. This is equivalent to using `store` (`→`) to manually set the variable yourself. Because the `DelVar` command is two bytes instead of one, there is no size difference between the two.

```
:0→A
same as
:DelVar A
```

While there is no size difference between the two, `DelVar` does have some problems that go along with using it. If used in a `For` loop to delete the counter variable or used to delete the variable and/or value in the `IS>(` or `DS<(` commands before using them, it will cause an ERR:UNDEFINED error.

This is a result of the way that the interpreter in TI-Basic is designed, so there is nothing you can do about it. You just need to be cognizant of it when using `DelVar` in a `For(` loop or together with `IS>(` or `DS<(`.

# Advanced Uses

When you are done using variables, you should delete them at the end of the program with the `DelVar` command to cleanup. Each variable takes up a set amount of space (for example, a real variable is 15 bytes), and the more variables you can delete the more free memory is available. Free memory helps your programs run faster and allows you to pack more things on your calculator.

Because the `DelVar` command doesn't update the `Ans` variable, you can use `DelVar` and the current value in `Ans` will still be preserved for later use.

# Optimizations

The `DelVar` command does not need a line break or colon (which indicates a new line of code) following the variable name. This allows you to make chains of variables (organized in whatever order you want), and it saves a byte for each line break or colon removed.

```
:DelVar A
:DelVar B
can be
:DelVar ADelVar B
```

Besides making chains of variables, the `DelVar` command also allows you to take the command from the next line and put it immediately after the `DelVar` command.

```
:DelVar A
:Disp "Hello
can be
:DelVar ADisp "Hello
```

There are, however, two cases in which the following statement will be ignored, so you should add a newline:

# Command Timings

The speed of the `DelVar` command depends on the circumstance where it is used. When the variable already exists, `DelVar` is slower because it has to deallocate the variable from the RAM. `DelVar` is also significantly slower for zeroing real variables when compared to using `→` to set the variable to 0. The speed difference becomes apparent when the value is reset many times but is not a major factor if only used sparingly.

# Error Conditions

**ERR:SYNTAX**is thrown when trying to delete a system variable (e.g.`DelVar`Xmin) or a program, even though this is syntactically correct.**ERR:UNDEFINED**is thrown if you delete the loop variable while inside the loop, or delete the variable used in`IS>(`or`DS<(`.**ERR:ARCHIVED**is thrown if you use`DelVar`on an archived variable.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/delvar

The DelVar Command

Deletes a variable or variables.

DelVar *var1*[,*var2*,…]

**Menu Location**

Starting in the program editor:

- Press F4 to enter the Var menu.
- Press 2 to select DelVar.

This command works on all calculators.

3 bytes

The `DelVar` command deletes variables from existence, making them undefined again. This is a good way of cleaning up at the end of a program, or of making sure that a variable is undefined before you use it in a symbolic expression.

For `DelVar` to work, the variable must not be archived or locked. It also doesn't work on any program that's currently running, or on system variables.

There are two commands which might be a better alternative to `DelVar`, however. `NewProb` deletes all 26 one-letter variables at once; however, it also clears things like the graph screen that you might want to see preserved. Declaring a variable as `Local` at the beginning of a program prevents you from needing to delete it afterward, and it also makes sure you don't overwrite any existing variables.

Newer calculators have a `DelType` command to delete all variables of a certain type (provided they're not locked or archived). This is risky: you'll almost certainly delete too much. It's better to use `DelVar`, even if you have to list a hundred variables to do it.

# Advanced Uses

Assembly programs might allow you to "hide" programs (or other variables) from the variable menu. This is actually done by marking the variable in question as "in use", the way a currently-running program is marked. As a result, you won't be able to delete a hidden variable, and trying to will give the "Variable or Flash application in use" error.

# Error Conditions

**140 - Argument must be a variable name** happens when trying to delete something that isn't a valid variable name.

**450 - Invalid in a function or current expression** happens when DelVar is used in a function.

**870 - Reserved name or system variable** happens when trying to delete a system variable.

**970 - Variable or Flash application in use** happens when trying to delete a currently running program.

**980 - Variable is locked, protected, or archived** happens when trying to delete a locked or archived variable.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:delvar

The DependAsk Command

Disables automatic calculations in the table.

DependAsk

Press:

- 2nd TBLSET to access the table settings menu.
- Use arrows and ENTER to select Ask from the Depend: line.

TI-83/84/+/SE

1 byte

When the `DependAsk` setting (opposed to the `DependAuto` setting) is turned on, values in the table are not automatically calculated. To calculate the value of an equation, you have to select the column corresponding to that equation in the row corresponding to the value at which to calculate it, and press ENTER. For example, to calculate Y1 at X=0, select the X=0 column, scroll right to Y1, and press ENTER.

The `DependAsk` setting might be useful when dealing with a difficult-to-calculate function, for which you wouldn't want to have to calculate values that aren't really necessary.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dependask

The DependAuto Command

Enables automatic calculations in the table.

DependAuto

Press:

- 2nd TBLSET to access the table settings menu.
- Use arrows and ENTER to select Auto from the Depend: line.

TI-83/84/+/SE

1 byte

When the `DependAuto` setting (opposed to the `DependAsk` setting) is turned on, values in the table are automatically calculated. With `IndpntAuto`, that means the table is automatically filled out completely; with `IndpntAsk`, that means that as soon as you enter a value for the independent variable, all the values of the dependent variables are calculated. This is usually the setting you want to use.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dependauto

The det( Command

Calculates the determinant of a square matrix.

det(*matrix*)

Press:

- MATRX (83) or 2nd MATRX (83+ or higher) to access the matrix menu
- LEFT to access the MATH submenu
- ENTER to select det(.

TI-83/84/+/SE

1 byte

The `det(` command calculates the determinant of a square matrix. If its argument is not a square matrix, ERR:INVALID DIM will be thrown.

# Advanced Uses

If [A] is an N×N matrix, then the roots of det([A]-X identity(N)) are the eigenvalues of [A].

# Formulas

For 2×2 matrices, the determinant is simply

(1)For larger matrices, the determinant can be computed using the Laplace expansion, which allows you to express the determinant of an n×n matrix in terms of the determinants of (n-1)×(n-1) matrices. However, since the Laplace expansion takes $O\left( n! \right)$ operations, the method usually used in calculators is Gaussian elimination, which only needs $O\left( n^3 \right)$ operations.

The matrix is first decomposed into a unit lower-triangular matrix and an upper-triangular matrix using elementary row operations:

(2)The determinant is then calculated as the product of the diagonal elements of the upper-triangular matrix.

# Error Conditions

**ERR:INVALID DIM**is thrown when the matrix is not square.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/det

The DiagnosticOff Command

Changes settings so that the correlation variables, r and r^{2}, are not displayed when calculating a regression

DiagnosticOff

Press:

- 2ND CATALOG to access the command catalog
- D to skip to commands starting with D
- Scroll down and select DiagnosticOff

(The DiagnosticOff command can't be found outside the catalog)

TI-83/84/+/SE

2 bytes

After the `DiagnosticOff` command is executed, all regression commands found in the STAT>CALC menu, as well as `LinRegTTest`, will not display the correlation statistics r and r^{2} (or just R^{2} in some cases). This is already turned off by default, although there is no disadvantage whatsoever to turning it on. To reverse this command, execute the `DiagnosticOn` command.

The statistic r, known as the correlation coefficient, measures the strength and direction of any linear relationship in the data (therefore if your regression model isn't linear, it may not exist, unless the calculator performed a transformation on the data). If r is close to 1, then the relationship is strong and positive (that is, the variables increase and decrease together). If r is close to -1, then the relationship is strong and negative (that is, as one variable increases, the other decreases). If r is close to 0, there is no linear relationship.

The statistic r^{2} or R^{2} is equal to the square of the above value (when it exists) and is also a measure of the strength of a relationship. Specifically, it represents the proportion of variance in the dependent variable that is accounted for by the regression model. If this value is close to 1, there is a strong relationship; if it's close to 0, there is either no relationship or the regression model doesn't fit the data.

# Advanced

Although these statistics are a good indication of whether a regression curve is good or not, they are not infallible. For example, the initial portion of data that actually correlates exponentially may well appear linear and have a high correlation coefficient with a linear fit.

Another good way to check a regression curve is to look at the plot of the residuals vs. the x-values. If the regression curve is a good fit, then this plot should appear random in going from positive to negative. However, should you see a distinct pattern - say, if you tried a linear fit but the residual plot looks vaguely parabolic - you know you should try a different regression curve.

You should also consider what your regression line implies about the nature of the data and vice versa. For example, if you're comparing the height of release of a ball to the time it takes to fall, a natural assumption is that the regression curve should pass through (0,0), and a curve that doesn't do that may be incorrect. However, take this advice with a grain of salt: if your curve fits the data points you put in but not such natural-assumption points, that may simply mean that the curve works on a limited domain. Or, it may mean your assumptions are wrong.

# Command Timings

Although the correlation statistics are not displayed with `DiagnosticOff`, they are calculated in either case. This means that `DiagnosticOn` and `DiagnosticOff` will not change how fast regressions are calculated.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/diagnosticoff

The DiagnosticOn Command

Changes settings so that the correlation variables, r and r² (or R²), are displayed when calculating a regression

DiagnosticOn

Press:

- 2ND CATALOG to access the command catalog
- D to skip to commands starting with D
- Scroll down and select DiagnosticOn

(The DiagnosticOn command can't be found outside the catalog)

TI-83/84/+/SE

2 bytes

After the `DiagnosticOn` command is executed, all regression commands found in the STAT>CALC menu, as well as `LinRegTTest`, will display the correlation statistics r and r² (or R^{2} for regressions that are not linear). This is turned off by default, but there is no disadvantage whatsoever to turning it on. To reverse this command, execute the `DiagnosticOff` command.

The statistic r, known as the Pearson correlation coefficient, measures the strength and direction of any linear relationship in the data. If r is close to 1, then the relationship is strong and positive (that is, the variables increase and decrease together). If r is close to -1, then the relationship is strong and negative (that is, as one variable increases, the other decreases). If r is close to 0, there is no linear relationship.

The statistic r² or R², known as the coefficient of determination, is equal to the square of the above value (when it exists) and is also a measure of the strength of a relationship. Specifically, it represents the proportion of variance in the dependent variable that is accounted for by the regression model. If this value is close to 1, there is a strong relationship; if it's close to 0, there is either no relationship or the regression model is not appropriate for the data.

# Advanced

Although these statistics are a good indication of whether a regression curve is good or not, they are not infallible. For example, the initial portion of data that actually correlates exponentially may well appear linear and have a high correlation coefficient with a linear fit.

Another good way to check a regression curve is to look at the plot of the residuals vs. the x-values. If the regression curve is a good fit, then this plot should appear random in going from positive to negative. However, should you see a distinct pattern - say, if you tried a linear fit but the residual plot looks vaguely parabolic - you know you should try a different regression curve.

You should also consider what your regression line implies about the nature of the data and vice versa. For example, if you're comparing the height of release of a ball to the time it takes to fall, a natural assumption is that the regression curve should pass through (0,0), and a curve that doesn't do that may be incorrect. However, take this advice with a grain of salt: if your curve fits the data points you put in but not such natural-assumption points, that may simply mean that the curve works on a limited domain. Or, it may mean your assumptions are wrong.

# Command Timings

Although the correlation statistics are displayed with `DiagnosticOn`, they are calculated in either case. This means that `DiagnosticOn` and `DiagnosticOff` will not change how fast regressions are calculated.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/diagnosticon

The Dialog Command

Displays a dialog box for input or output.

:Dialog

*(dialog elements)*

:EndDlog

**Menu Location**

Starting in the program editor:

- Press F3 to enter the I/O menu.
- Press 1 to enter the Dialog submenu.
- Press 5 to paste Dialog..EndDlog.

This command works on all calculators.

2 bytes for Dialog;

2 bytes for EndDlog.

A `Dialog`..`EndDlog` block is used to display a dialog box that can be used for input, output, or both. There are several commands that can be used inside `Dialog`..`EndDlog` to determine its content:

- At most one
`Title`instruction (to add a title). `Text`(to add a line of text).`Request`(to add a text entry box).`DropDown`(to add a drop-down menu).

Except for the `Title` instruction, you can mix and match any number of these (as many as will fit on the screen), and their order will determine the order they are displayed. Finally, two "buttons" labeled Enter=OK and ESC=CANCEL will be displayed at the bottom of the dialog box.

Here is a typical dialog box to input a variable name:

```
:Dialog
: Title "Load file"
: Request "File name", name
: Text "(include folder name if not ""main"")"
:EndDlog
```

# Advanced Uses

The system variable "ok" will detect if Enter or ESC was used to exit the dialog: it will have a value of 1 if Enter was used, and 0 for ESC.

This is particularly important when you're looking for input. If ESC is used, then the variables used in `Request` or `DropDown` will not be changed from what they were before (if they were undefined, they will remain undefined). It's probably a good idea to detect that sort of thing.

# Error Conditions

**230 - Dimension** happens when the dialog would be too wide or too tall to fit on the screen.

**470 - Invalid in Dialog..EndDlog block** happens when instructions other than `Title`, `Text`, `Request`, `DropDown` are used.

**590 - Invalid syntax block** happens when something miscellaneous goes wrong, e.g. there is more than one `Title`.

**730 - Missing start or end of block syntax** happens when the `Dialog` is missing its `EndDlog`, or vice versa.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dialog

The dim( Command

Returns the size of a list or matrix. Can also be used to change the size.

dim(*list*

dim(*matrix*

*length*→dim(*list*

{*rows*,*columns*→dim(*matrix*

Press:

- 2nd LIST to access the list menu
- RIGHT to access the OPS submenu
- 3 to choose dim(, or use arrows

Alternatively, press:

- MATRIX (83) or 2nd MATRIX (83+ or higher) to access the matrix menu
- RIGHT to access the MATH submenu
- 3 to choose dim(, or use arrows

TI-83/84/+/SE

1 byte

The `dim(` command is used to find the size of an existing list or matrix. It takes only one argument - the list or matrix you want the size of. For a list, it returns the number of elements; for a matrix, it returns a two-element list of the number of rows and the number of columns.

```
:dim(L1
5
:dim([A]
{2,3}
```

The `dim(` command can also be used to change the size of a list or matrix; this is perhaps its most important use. To do this, just store the desired size to the list or matrix (the `dim(` command is the only one you can store in as though it were a variable).

```
:7→dim(L1
:{2,2→dim([A]
```

For a list, if this increases the size, zero elements will be added to the end of the list; if this decreases the size, elements will be removed starting from the end.

For a matrix, if this increases the number of rows or columns, new rows or columns filled with zeros will be added to the bottom and right respectively. If this decreases the number of rows and columns, those rows and columns will be removed starting from the bottom (for rows) and right (for columns).

If a list or matrix doesn't exist before its size is changed, the `dim(` command will actually create it with the correct size. All the elements, in this case, will be set to 0.

# Advanced Uses

In the case of lists, the `dim(` command is used in adding an element to the end of a list. Although `augment(` can be used for the same task, `dim(` is faster - but takes more memory. For example, to add the element 5 to the end of L1:

`:5→L1(1+dim(L1`

It's also possible, using the `dim(` command, to set the size of a list to 0. In this case, the list exists, but doesn't take up any memory, and cannot be used in expressions (similar to the output of `ClrList`). This is not really useful.

# Optimization

When creating a list or matrix using `dim(`, all the elements are preset to 0; this can be used in place of the `Fill(` command to set a list or matrix to a bunch of zeros in a program. Since we don't usually know for sure that the list or matrix doesn't exist, we must first delete it with `DelVar`.

```
:{5,5→dim([A]
:Fill(0,[A]
can be
:DelVar [A]{5,5→dim([A]
```

# Error Conditions

**ERR:INVALID DIM**is thrown if you try to make a list or matrix bigger than 999 or 99x99 elements respectively, or if you try to create a matrix that isn't 2-dimensional.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dim

The dim() Command

Returns the size of a list, matrix, or string.

dim(*list-matrix-or-string*)

**Menu Location**

- Press 2nd MATH to enter the MATH menu.
- Press D to enter the String submenu.
- Press 3 to select dim(.

This command works on all calculators.

1 byte

The `dim()` command returns the size of a list, matrix, or string:

- The number of elements for a list.
- The number of characters for a string.
- A list of {number of rows or columns} for a matrix.

This command is critical to using any of these objects, for instance, if you want to write a `For`..`EndFor` loop to look at every element.

However, unlike the TI-83 series version, you can't use the `dim()` command to change the size of anything. Use `mid()` to get a smaller list or string (`subMat()` for a matrix), or use `newList()` and `newMat()` to create a list or matrix of a specific size.

```
:dim({1,2,3,4,5}
5
:dim("TI-Basic Developer")
18
:dim([1,2,3;4,5,6])
{2 3}
```

# Optimization

For matrices, using `rowDim()` and `colDim()` is usually better in all practical situations, and you don't have to remember which number goes first.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:dim

The Disp Command

Displays an expression, a string, or several expressions and strings on the home screen.

Disp [argument1,argument2,…]

While editing a program, press:

- PRGM to enter the PRGM menu
- RIGHT to enter the I/O menu
- 3 to select Disp (or use arrows to select)

TI-83/84/+/SE

1 byte

The first, and easiest, way to display text is using the `Disp` command. You can display whatever combination of text and values that you want. Text is displayed on the left side of the screen, while numbers, variables and expressions are displayed on the right side. Text can be moved over to the right by padding it with spaces, but there is no equivalent for numbers, variables, and expressions.

When displaying a matrix or a list, and the matrix or list is too large to display in its entirety, an ellipsis (…) is displayed at the boundaries of the screen. The matrix or list, unfortunately, cannot be scrolled so the rest of it can be seen (use the `Pause` command instead).

With the small screen size, you have to keep formatting in mind when displaying text. Because the text does not wrap to the next line if it is longer than sixteen characters, the text gets cut off and an ellipsis is displayed at the end of the line. When the text you want to display is longer than sixteen characters, you should break the text up and display each part with its own `Disp` command.

```
:Disp "Just Saying Hello
Break the text up
:Disp "Just Saying
:Disp "Hello
```

The `Disp` command displays text line by line, giving each argument its own blank line. If the screen is clear, the arguments are displayed beginning at the first line. But if there is text on the first line, the arguments are displayed beginning at the first available blank line. When all the lines have text on them including the last, the screen will automatically scroll up until every line is blank.

This means that, while a `Disp` command can technically display an unlimited amount of lines of text, you should not display more than seven consecutive lines of text at any one time (because of the screen height). If there are too many arguments, the arguments that were displayed will be pushed up out of sight, to allow the other arguments to be displayed. This is usually not desired, but it can be used to create some cool scrolling effects by messing with the text that you display.

The result is that you can never display text on the last line of the screen using the `Disp` command; you need to use the `Output(` command. (Using `Output(` does not have any affect on `Disp` and its text.) Also, if you have more than seven lines of text to display, you will need to place the `Pause` command after every seven lines to prevent the screen from scrolling. These two scenarios come up fairly often, so it is good to know how to deal with them.

```
PROGRAM:DISP
:ClrHome
:Disp A,B,C,D,E,F,G
:Pause
:Disp A,B,C,D,E,F,G
:Output(8,16,H
```

Like other text display commands, you can display each function and command as text. However, this is not without problems as each function and command is counted as one character. The two characters that you can't display are quotation marks (") and the store command (→). However, you can mimic these respectively by using two apostrophes (''), and two subtract signs and a greater than sign (—>).

# Advanced Uses

You can use the `Disp` command by itself, which simply displays the home screen.

`:Disp`

When you use an empty string with no text (i.e., two quotes side by side — ""), a blank line is displayed.

`:Disp ""`

# Optimization

When you have a list of `Disp` commands (and each one has its own argument), you can just use the first `Disp` command and combine the rest of the other `Disp` commands with it. You remove the `Disp` commands and combine the arguments, separating each argument with a comma. The arguments can be composed of whatever combination of text, numbers, variables, or expressions is desired.

The advantages of combining `Disp` commands are that it makes scrolling through code faster, and it is smaller when just displaying numbers, variables, or expressions. The disadvantages are that it can hinder readability (make the code harder to read) when you have lots of varied arguments, and it is easier to accidentally erase a `Disp` command with multiple arguments.

```
:Disp A
:Disp B
Combine the Disp commands
:Disp A,B
```

If you have a string of numbers that you are displaying, you do not need to put quotes around the numbers. This causes the numbers to be displayed on the right side of the screen, and they cease being a string. You may want to keep the numbers in a string, though, if they have any leading zeros. Because the numbers are no longer in a string, the leading zeros are truncated (taken off).

```
:Disp "2345
Remove the Quotes
:Disp 2345
```

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/disp

The DispGraph Command

Displays the graph screen.

DispGraph

While editing a program, press:

- PRGM to access the program menu.
- RIGHT to access the I/O submenu.
- 4 to select DispGraph, or use arrows and ENTER.

TI-83/84/+/SE

1 byte

The `DispGraph` command displays the graph screen, along with everything drawn or graphed on it.

In many cases, this doesn't need to be done explicitly: commands from the 2nd DRAW menu, as well as many other graph screen commands, will display the graph screen automatically when they are used. Mainly, it's used for displaying the graphs of equations or plots in a program — you would define the variable in question, then use `DispGraph` to graph it. For example:

```
:"sin(X)"→Y1
:DispGraph
```

# Advanced Uses

`DispGraph` can also be used to update the graph screen, even if it's already being displayed. For example, changing the value of a plot or equation variable doesn't update the graph immediately. Consider this program:

```
:0→I
:"Isin(X)"→Y1
:DispGraph
:For(I,1,10)
:End
```

At first, it graphs the equation Y=Isin(X) with I=0. After this, I is cycled from 1 to 10. However, though the parameter I changes, the graph screen isn't updated, and only the initial graph of Y=0sin(X) and final graph of Y=10sin(X) are displayed. If, on the other hand, we change the program:

```
:0→I
:"Isin(X)"→Y1
:DispGraph
:For(I,1,10)
:DispGraph
:End
```

Now the `DispGraph` inside the loop ensures that the graph screen is updated every time, and the program will correctly display all eleven graphs.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dispgraph

The DispTable Command

Displays the table screen.

DispTable

While editing a program, press:

- PRGM to access the program menu
- RIGHT to select the I/O submenu
- 5 to select DispTable, or use arrows and ENTER

TI-83/84/+/SE

1 byte

The `DispTable` comand displays the table screen you normally see by pressing 2nd TABLE, from a running program. The user will see the table screen with a "paused" run indicator, and will be able to use arrows to scroll through it. Pressing ENTER will exit the screen and continue the program.

# Advanced Uses

The user can't select any cells in the table to be evaluated if they're not, already. So it's best to select the `IndpntAuto` and `DependAuto` options from the 2nd TBLSET menu before using this command. `IndpntAsk` can also work, however, as long as you store to `TblInput` first.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/disptable

The ►DMS Command

Formats a displayed number as a degree-minute-second angle.

*value*►DMS

Press:

- 2nd ANGLE to access the angle menu.
- 4 to select ►DMS, or use arrows and ENTER.

TI-83/84/+/SE

1 byte

The `►DMS` command can be used when displaying a real number on the home screen, or with the `Disp` and `Pause` commands. It will then format the number as an angle with degree, minute, and second parts.

```
30►DMS
30°0'0"
100/9°►DMS
11°6'40"
```

It will also work when displaying a number by putting it on the last line of a program by itself. It does **not** work with `Output(`, `Text(`, or any other more complicated display commands.

Although `►DMS` is meant as a way to format angles in `Degree mode`, it doesn't depend on the angle mode chosen, only on the number itself. Note that entering a number as *degree*°*minute*'*second*" will also work, in any mode, and it will not be converted to radians in `Radian mode`.

# Error Conditions

**ERR:SYNTAX**is thrown if the command is used somewhere other than the allowed display commands.**ERR:DATA TYPE**is thrown if the value is complex, or if given a list or matrix as argument.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dms

The Dot Command

Sets all equations to use the dotted-line graphing style, and makes it the default setting.

Dot

Press:

- MODE to access the mode menu.
- Use arrows to select Dot.

TI-83/84/+/SE

2 bytes

The `Dot` command sets all equations to use the disconnected "dotted-line" graph style: it calculates and draws points on the graph, but doesn't connect them. In addition, this graph style is made the default, so that when a variable is deleted it will revert to this graph style. The other possible setting for this option is `Connected`.

Compare this to the `GraphStyle(` command, which puts a single equation into a specified graph style.

The `Connected` and `Dot` commands don't depend on graphing mode, and will always affect all functions, even in other graphing modes. The exception to this is that sequence mode's default is always the dotted-line style, even when `Connected` mode is set. The `Connected` command will still change their graphing style, it just won't change the default they revert to.

In addition to graphing equations, this setting also affects the output of `DrawF`, `DrawInv`, and `Tangent(`.

# Advanced Uses

Functions graphed using the dotted-line graph style are very strongly affected by the `Xres` setting (which determines how many points on a graph are chosen to be graphed). If `Xres` is a high setting (which means many pixels are skipped), functions in dotted-line mode will be made up of fewer points (in connected mode, this will also be the case, but because the points are connected this isn't as noticeable). You should probably set `Xres` to 1 if you're going to be using the dotted-line graph style — even 2 is pushing it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/dot

The DrawF Command

Draws an expression in terms of X.

DrawF *expression*

Press:

- 2nd PRGM to access the draw menu.
- 6 to select DrawF, or use arrows and ENTER.

TI-83/84/+/SE

1 byte

The `DrawF` commands draws a single expression on the graph screen in terms of X using `Func` graphing mode, regardless of what graphing mode the calculator is actually in. For example, `DrawF X²` will draw a parabola in the shape of a U on the screen. Of course, how it is displayed all depends on the window dimensions of the graph screen; you should use a friendly window to ensure it shows up as you intend.

# Advanced Uses

`DrawF` will update X and Y for each coordinate drawn (like `Tangent(` and `DrawInv`), and exit with the last coordinate still stored.

When evaluating the expression using `DrawF`, the calculator will ignore the following errors: ERR:DATA TYPE, ERR:DIVIDE BY 0, ERR:DOMAIN, ERR:INCREMENT, ERR:NONREAL ANS, ERR:OVERFLOW, and ERR:SINGULAR MAT. If one of these errors occurs, the data point will be omitted.

For this reason, `DrawF` can sometimes behave in an unexpected fashion: for example, it doesn't throw an error for list or matrix expressions (it won't graph anything, either).

You can use `DrawF` to draw an expression instead of having to store an expression to a Y# variable and then displaying it. At the same time, if you plan on manipulating the expression (either changing the value or changing the expression itself), it would be better to simply use the Y# variable.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/drawf

The DrawInv Command

Draws the inverse of a curve in terms of X.

DrawInv *curve*

Press:

- 2nd DRAW to access the draw menu.
- 8 to select DrawInv, or use arrows and ENTER.

TI-83/84/+/SE

1 byte

The `DrawInv` command draws the inverse of a curve in terms of X. Its single argument is an expression in terms of X.

For example, `DrawInv X²` will draw the inverse of the equation Y=X^{2}. The inverse reverses the variables X and Y, so that the curve X=Y^{2} will be graphed. In this case, the inverse of the function has a simple form: Y=√(X) and Y=-√(X); most functions, however, do not have an inverse expressible as Y= equation, making this command particularly useful.

You can also think of this as graphing the expression but with X representing the vertical direction, and Y representing the horizontal.

`DrawInv` requires the calculator to be in `Func` mode, and is affected by the `Connected`/`Dot` setting.

# Advanced Uses

`DrawInv` will update X and Y for each coordinate drawn (like `Tangent(` and `DrawF`), and exit with the last coordinate still stored.

When evaluating the expression using `DrawInv`, the calculator will ignore the following errors: ERR:DATA TYPE, ERR:DIVIDE BY 0, ERR:DOMAIN, ERR:INCREMENT, ERR:NONREAL ANS, ERR:OVERFLOW, and ERR:SINGULAR MAT. If one of these errors occurs, the data point will be omitted.

For this reason, `DrawInv` can sometimes behave in an unexpected fashion: for example, it doesn't throw an error for list or matrix expressions (it won't graph anything, either).

# Error Conditions

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/drawinv

The DS<( Command

Decrements a variable by 1 and skips the next command if the variable is less than the value.

DS<(*variable*,*value*)

*command*

While editing a program, press:

- PRGM to enter the PRGM menu
- ALPHA APPS (or 'B') to choose DS<(, or use arrows

TI-83/84/+/SE

1 byte

The decrement and skip if less than command — `DS<(` — is a specialized conditional command. It is equivalent to an `If` conditional, except the next command will be skipped when the condition is true and it has a variable update built-in. However, it is not used very often (if anything, it is often misused as a looping command) because of its obscure name and somewhat limited application.

The `DS<(` command takes two arguments:

- A variable, which is limited only to one of the real variables (A-Z or θ).
- A value, which can be either a number, variable, or expression (a combination of numbers and variables).

When `DS<(` is executed it subtracts one from the variable (decrements it by one), and compares it to the value. The next command will be skipped if the variable is less than the value, while the next command will be executed if the variable is greater than or equal to the value.

The command `DS<(A,B` is equivalent to the following code:

```
:A-1→A
:If A≥B
```

Here are the two main cases where the `DS<(` command is used:

```
:5→A
:DS<(A,6
:Disp "Skipped
```

- Initializes the A variable to 5 and then compares to the value
- 5<6 is true so the display message won't be displayed

```
:3→B
:DS<(B,2
:Disp "Not Skipped
```

- Initializes the B variable to 3 and then compares to the value
- 3<2 is false so the display message will be displayed

Note: In addition to both of these cases, there is also the case where the variable and the value are equal to each other. This case is shown below under the 'Advanced Uses' section because it has some added background that goes with it.

# Advanced Uses

When you want the skipping feature of the `DS<(` command to always occur, you just have to use the same variable for both the variable and value arguments of the command:

`:DS<(B,B`

An undefined error will occur if the variable and/or value doesn't exist before the `DS<(` command is used, which happens when the `DelVar` command is used. Consequently, you should not use `DelVar` with `DS<(`.

A similar code can be used as a substitute for B-1→B if you don't want to change `Ans`:

`:DS<(B,B:`

Note that due to the colon after the line, there will be no statement skipped, so you don't have to worry about that.

# Optimization

If a program needs to decrement a positive variable, `DS<(` is one byte smaller than than decrementing a variable normally.

```
:A-1→A
can be
:DS<(A,0
```

The one caution about this is that if the variable is less than the value (in this case, '0'), the next command will be skipped. If you don't want the skipping functionality, then it is necessary to make sure that the value is never greater than the variable. Also, `DS<(` is slower than its more often used counterpart.

Related to the example code given, `DS<(` should always have a command following after it (i.e. it's not the last command in a program) because it will return an error otherwise. If you have no particular code choice, an empty line will suffice.

```
code that will run
:DS<(A,0
:
more code that will run
```

# Command Timings

Using `DS<(` to decrement a variable is approximately 25% slower than using code like X-1→X. However, it is faster to use `DS<(` than to construct an `If` statement to do the same thing.

Note, however, that a quirk in the `For(` command (see its Optimization section) will slow down the `DS<(` command significantly if a closing parenthesis is not used for the `For(` statement.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.**ERR:SYNTAX**is thrown if there is no next line to skip.**ERR:UNDEFINED**is thrown if the variable to be decremented is not defined.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/ds

The e Command

` e` is a constant on the TI-83 series calculators. The constant holds the approximate value of Euler's number, fairly important in calculus and other higher-level mathematics.

The approximate value, to as many digits as stored in the calculator, is 2.718281828459…

The main use of ` e` is as the base of the exponential function

`e^(`(which is also a separate function on the calculator), and its inverse, the natural logarithm

`ln(`. From these functions, others such as the trigonometric functions (e.g.

`sin(`) and the hyperbolic functions (e.g.

`sinh(`) can be defined. In

`re^θi`mode,

`is used in an alternate form of expressing complex numbers.`

*e*Important as the number ` e` is, nine times out of ten you won't need the constant itself when using your calculator, but rather the

`e^(`and

`ln(`functions.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/e-value

The e^( Command

Raises the constant *e* to the *value* power.

*e*^(*value*)

Press [2nd] [*e*^{x}] to paste *e*^(.

TI-83/84/+/SE

1 byte

The ` e^(` command raises the constant

`to a power. Since it's possible to just type out`

*e*`, ^, and (, the reason for having a separate function isn't immediately obvious but in fact most of the time you need to use`

*e*`, it's to raise it to a power.`

*e*The trigonometric and hyperbolic functions can be expressed, and in fact are usually defined, in terms of ` e^(`.

` e^(` accepts numbers and lists (but unfortunately not matrices) as arguments. It also works, and is often used for, complex numbers (in fact, one of the standard forms of complex numbers on TI-83 series calculators is

`re^θi`, which uses the

`function`

*e*^(`)`

```
e^(2)
7.389056099
e^(πi)
-1
e^({-1,0,1})
{.3678794412 1 2.718281828}
```

# Formulas

The ` e^(` is usually defined by an infinite series:

This is then used to define exponentiation in general (for all real and even complex numbers), rather than using some sort of definition of exponents that involves multiplying a number by itself many times (which only works for integers).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/e-exponent

The E Command

The E symbol is used for entering numbers in scientific notation.

*mantissa* E *exponent*

Press [2nd][EE] to paste the E command.

TI-83/84/+/SE

1 byte

The `E` symbol is used for entering numbers in scientific notation: it's short for *10^. This means that in many cases, its function is identical to that of the `10^(` command (aside from the parenthesis). However, the exponent of `E` is limited to constant integer values ‾99 to 99.

The `E` symbol is used in display by the calculator for large numbers, or when in `Sci` (scientific) or `Eng` (engineering) mode.

Unlike the exponent of `E`, the mantissa (a special term for the A in A*10^B, in scientific notation) isn't limited in variable type: it can be a constant, a real or complex variable or expression, a list, a matrix, or even omitted entirely (and then it will be assumed to equal 1). The reason for this versatility is simple: internally, only the exponent is taken to be an actual argument for this command. The rest of the calculation is done through implied multiplication.

5E3

………………5000

E‾5

……………….00001

# Advanced Uses

`E`99 and -`E`99 are often used for negative and positive infinity because the TI-83 series of calculators doesn't have an infinity symbol. Commands that often need to use infinity include `solve(`, `fnInt(`, `normalcdf(` (and the other distributions), and many others. The error introduced in this way is usually irrelevant, because it's less than the minimum calculator precision, anyway: `E`99 is mindbogglingly huge.

# Optimization

Don't add the mantissa when it's 1:

1E5

should be

E5

In addition, `E`2 or `E`3 can be used as shorthand ways of writing 100 and 1000 respectively. This could be continued, in theory, for higher powers of 10, but those aren't necessary as often.

# Command Timings

`E` is much faster than using the `10^(` command or typing out 10^. The drawback, of course, is that it's limited to constant values.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/e-ten

The ►Eff( Command

Converts a nominal interest rate to an effective interest rate.

►Eff(*interest rate*,*compounding periods*)

On the TI-83, press:

- 2nd FINANCE to access the finance menu.
- ALPHA C to select ►Eff(.

On the TI-83+ or higher, press:

- APPS to access the applications menu.
- ENTER or 1 to select Finance…
- ALPHA C to select ►Eff(.

TI-83/84/+/SE

2 bytes

The `►Eff(` command converts from a nominal interest rate to an effective interest rate. In other words, it converts an interest rate that does not take into account compounding periods into one that does. The two arguments are 1) the interest rate and 2) the number of compounding periods.

For example, take an interest rate of 7.5% per year, compounded monthly. You can use `►Eff(` to find out the actual percent of interest per year:

```
►Eff(7.5,12)
7.663259886
```

# Formulas

The formula for converting from a nominal rate to an effective rate is:

(1)Here, Eff is the effective rate, Nom is the nominal rate, and CP is the number of compounding periods.

# Error Conditions

**ERR:DOMAIN**is thrown if the number of compounding periods is not positive, or if the nominal rate is -100% or lower (an exception's made for the nominal rate if there is only one compounding period, since`►Eff(`X,1`)`=X)

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/eff

The End Command

Indicates the end of a block of statements.

If *condition*

Then

*statement(s)*

End

While *condition*

*statement(s)*

End

Repeat *condition*

*statement(s)*

End

For(*variable*,*start*,*end*[,*step*])

*statement(s)*

End

While editing a program, press:

- PRGM to enter the PRGM menu
- 7 to choose End, or use arrows

TI-83/84/+/SE

1 byte

The `End` command is used together with the different control structures, including the `If` conditional, `While` loop, `Repeat` loop, and `For(` loop, to indicate the *end* of the code block for the respective control structure. In the case of the `If` conditional, you also need to add a `Then` command, which is used to indicate the beginning of the control structure.

# Advanced Uses

You can prematurely end a control structure by using a single `If` conditional and then having `End` be its executed command. Because the calculator stores the positions of the `End` commands, it will take this `End` command to be the `End` command of the control structure.

```
:If <condition>
:End
```

One of the most important features of the `End` command is putting multiple control structures inside of each other (known as nesting). While you typically nest `If` conditionals inside of loops, you can actually nest any control structure inside of any other control structure — this even works when using the same control structure, such as a `While` loop inside of another `While` loop.

When nesting control structures, you need to remember to put the appropriate number of `End` commands to close the appropriate structure. The easiest way to keep track of lots of nested control structures is to code the first part, add an `End` immediately after the beginning, and then hit 2nd DEL on the line with the `End`, then hit ENTER a lot of times.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.**ERR:SYNTAX**occurs if this statement is used before a logic block has been initiated.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/end

The Eng Command

Puts the calculator in engineering notation mode.

Eng

While editing a program, press:

- MODE to access the mode menu.
- Use arrows and ENTER to select Eng.

TI-83/84/+/SE

1 byte

The `Eng` command puts the calculator in engineering notation mode. This is a variation on scientific notation in which the exponent is restricted to be a multiple of 3 (and the mantissa can range between 1 and 1000, not including 1000 itself)

```
Eng
Done
12345
12.345e3
{1,2,3}
{1e0 2e0 3e0}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/eng

The Equ►String( Command

Stores the contents of an equation variable to a string.

Equ►String(*equation*,*string*

This command is found only in the catalog. Press:

- 2nd CATALOG to access the catalog
- F to skip to commands starting with F
- Scroll up to Equ►String( and select it.

TI-83/84/+/SE

2 bytes

This command stores the contents of an equation variable (such as Y_{1} or X_{1T}) to a string (one of Str0, Str1, … Str9). This can be used when you want to display the equation as text (either using the `Text(` command on the graph screen, or the `Output(` or `Disp` commands on the home screen). For example:

```
:Equ►String(Y1,Str1
:Text(0,0,"Y1(X)=",Str1
```

Apart from cases in which the user has already stored to the equation variable prior to running the program, about the only situation in which you would use `Equ►String(` is for the output of a regression.

# Advanced

You can use `Equ►String(` (outside a program) to get the `→` or " symbols in a string:

- Type them on the home screen and press [ENTER]
- Select 2:Quit when the
**ERR:SYNTAX**comes up. - Press [Y=] to go to the equation editor.
- Press [2nd] [ENTRY] to recall the symbols to Y
_{1} - Now, use
`Equ►String(`Y_{1},Str1`)`to store the symbols to a string.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/equ-string

The ExecLib Command

Calls a library routine from an application opened with OpenLib(

ExecLib

This command can be found in the Prgm Editor CTL menu, press:

- Press "PRGM" while in the Program Editor.
- Go to the last command and press "Enter".

TI-84+/SE

2 bytes

Together with `OpenLib(`, `ExecLib` is used on the TI-84 Plus and TI-84 Plus SE for running routines from a Flash App library. This only works, of course, with libraries that have been specifically written for this purpose. The only such library so far is usb8x, for advanced interfacing with the USB port.

Since `ExecLib` doesn't have any arguments, it would normally be able to run only one library routine. To get around this, usb8x uses a list passed in `Ans` as arguments to the command. This is most likely how any future libraries will do it as well.

The following program, which displays the version of usb8x, is an example of how to use `OpenLib(` and `ExecLib`:

```
:OpenLib(USBDRV8X
:{6
:ExecLib
:Ans(2)+.01Ans(3
```

Download usb8x here. You may also be interested in MSD8x which is a GUI for usb8x.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/execlib

The Exit Command

Exits a loop.

:Exit

**Menu Location**

Starting in the program editor:

- Press F2 to enter the Control menu.
- Press 8 to enter the Transfers submenu.
- Press 5 to select Exit.

This command works on all calculators.

4 bytes

The Exit command immediately exits from a For..EndFor, Loop..EndLoop, or While..EndWhile loop. The program continues running from the instruction after the EndFor, EndLoop, or EndWhile.

Exit is especially useful for Loop..EndLoop, because the loop won't ever end if you don't give it a reason to. For example:

```
:Loop
: Input "Number 1-100",num
: If 1≤num and num≤100
: Exit
: Disp "Number out of range!"
:EndLoop
```

Often, a Loop..EndLoop block with an Exit inside it isn't a very good idea, because it can be replaced by a While..EndWhile block. However, in the example above, there is a difference: the condition for exiting the loop is not checked at the beginning. A While..EndWhile loop that did the same thing would have to initialize the num variable first.

If there are multiple loops, one nested inside the other, the Exit command only exits out of the innermost one.

The Exit command can also be used to exit a sub-routine (very helpful when using subroutines on a 'skeleton' during development)

# Optimization

Although Goto can also be used to exit out of a loop, the Exit command is faster: it knows where the end of the loop is, but a Goto command has to search through the entire program to find its label.

However, the Goto command is more versatile, since it can jump anywhere in the program, not just immediately after the loop. In particular, Goto can be used to exit multiple loops at once.

# Error Conditions

**560 - Invalid outside Loop..EndLoop, For..EndFor, or While..EndWhile blocks** happens when the Exit command is not inside a loop.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:exit

The expr( Command

Returns the value of a string that contains an expression.

expr(*string*)

This command is found only in the Catalog. Press:

- 2ND CATALOG to enter the catalog
- F to go to commands starting with F
- Scroll up a bit to expr(.

TI-83/84/+/SE

2 bytes

The expr( command is used to evaluate an expression that's stored in a string (an expression is merely anything that returns a value - of any type). Expressions are occasionally stored to strings, rather than evaluated outright, so that their value has the capacity to change when the variables stored inside them change. The expr( command's result depends on the kind of expression that's in the string you pass it — it may return a number, a list, a matrix, or even another string.

As a special case of an expression, the expr( command can also be used to convert a string like "123" to the number 123. Going in the reverse direction (123 to "123") is more complicated.

The expr( command has limitations. Here are the situations in which expr( will not work:

- When the code in the string does not return an answer, and thus is not an expression: e.g. expr("Line(0,0,1,1" or expr("prgmHELLO" is invalid
- When the expression in the string contains an expr( command itself, e.g. expr("expr(Str1" — this will throw an ERR:ILLEGAL NEST error.
- In place of a variable (rather than an expression), e.g. 5→expr("X" isn't a substitute for 5→X because expr("X" evaluates to the value of X and not to X itself.

# Advanced Uses

expr( is often used in conjunction with the Input command to prompt the user to enter a list. Although the Input command can already handle lists, it requires the user to enter the opening bracket that signifies a list. With expr(, this can be avoided.

Instead of:

`:Input L1`

Use this:

```
:Input Str1
:expr("{"+Str1→L1
```

# Optimization

Evaluating an expression inside a string is more complicated than evaluating a normal expression; you should therefore try to take as much out of an expr( statement as possible to speed up your code. For example:

```
:expr("sum({"+Str1
can be
:sum(expr("{"+Str1
```

# Error Conditions

**ERR:ILLEGAL NEST**is thrown when the string to be evaluated contains an expr( itself.**ERR:INVALID**is thrown when trying to evaluate the empty string.**ERR:SYNTAX**is thrown when trying to evaluate a command that doesn't return a value.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/expr

The expr() Command

Runs code stored inside a string.

expr(*string*)

**Menu Location**

- Press MATH to enter the MATH popup menu.
- Press D to enter the Strings submenu.
- Press 2 to select expr(.

This command works on all calculators.

2 bytes

The expr() command runs code stored inside a string: for instance, expr("5→x") has the same effect as 5→x. The main use of expr() is with user input: the input you get from some commands comes in a string, and you might use expr() to convert it back to a number.

The other advantage of using expr() is that you can paste together code as the program is running, to run something you couldn't possibly have put in the program ahead of time. For instance, you might paste together a Dialog..EndDlog block whose elements might be different every time you run the program.

```
:expr("5→x")
5
:expr("25")
25
```

The expr() command is somewhat limited in what it is allowed to do. For instance, if a string contains a variable name, expr() of that string returns the *value* of that variable; to refer to the variable itself, use the # (indirection) operator.

Another limitation is that expr() cannot contain commands that aren't allowed on the home screen, even if you're running it from a function or program. For example, Local will cause an error in expr().

Finally, in some respects expr() is actually running in its own program. It will still be able to access local variables from outside the expr(), but Lbl and Goto are limited — you can't jump out of expr() with them, nor can you jump in.

# Advanced Uses

It's best to use expr() sparingly. Characters inside a string are ignored during tokenization, so they will take up more space than actual commands, and there will be a short delay before the code inside expr() can run.

This also causes problems with language localization. Normally, once a command is tokenized, it will work in any language. However, with expr(), code is tokenized on the spot, so it will depend on the language being the same. If your program was written using English language localization, it will not work for someone who's working in German, Spanish, or French.

# Error Conditions

**550 - Invalid outside function or program** happens when the string contains commands that need to be inside a function or a program to work.

# Related Commands

- # (indirection)
- string()
- ord()

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:expr

The ExpReg Command

Calculates the best fit exponential curve through a set of points.

ExpReg [*x-list*, *y-list*, [*frequency*], [*equation*]

Press:

- STAT to access the statistics menu
- LEFT to access the CALC submenu
- 0 to select ExpReg, or use arrows

TI-83/84/+/SE

1 byte

`ExpReg` tries to fit an exponential curve (y=a*b^{x}) through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates ordered so that the Nth element of one list matches up with the Nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points.

The calculator does this regression by taking the natural log ln( of the y-coordinates (this isn't stored anywhere) and then doing a linear regression. The result, ln(y)=ln(a)+x*ln(b), is transformed into y=e^{ln(a)}(e^{ln(b)})^{x}, which is an exponential curve. This algorithm shows that if any y-coordinates are negative or 0, the calculator will instantly quit with ERR:DOMAIN.

In its simplest form, `ExpReg` takes no arguments, and fits an exponential curve through the points in L₁ and L₂:

```
:{9,13,21,30,31,31,34→L₁
:{260,320,420,530,560,550,590→L₂
:LnReg
```

On the home screen, or as the last line of a program, this will display the equation of the curve: you'll be shown the format, y=a*b^x, and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, r, and r² will be set as well. These latter two variables will be displayed only if "Diagnostic Mode" is turned on (see `DiagnosticOn` and `DiagnosticOff`).

You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example:

```
:{9,13,21,30,31,31,34→FAT
:{260,320,420,530,560,550,590→CALS
:ExpReg ∟FAT,∟CALS
```

You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂.

Finally, you can enter an equation variable (such as Y₁) after the command, so that the curve's equation is stored in this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the equation will be in terms of X anyway, this doesn't make much sense.

An example of `ExpReg` with all the optional arguments:

```
:{9,13,21,30,31,31,34→FAT
:{260,320,420,530,560,550,590→CALS
:{2,1,1,1,2,1,1→FREQ
:ExpReg ∟FAT,∟CALS,∟FREQ,Y1
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/expreg

The ExprOff Command

The number of the equation or plot being traced is displayed in the top right corner.

ExprOff

Press:

- 2nd FORMAT to access the graph format menu
- Use arrows and ENTER to select ExprOff

TI-83/84/+/SE

2 bytes

The `ExprOff` command enables a "short" form of displaying the equation or plot being traced. That is, only the number of the equation or plot will be displayed, in the top right corner of the screen. When tracing a plot, the number will be prefixed with a P to distinguish it from an equation.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/exproff

The ExprOn Command

The equation or plot being traced is displayed in long form at the top of the screen.

ExprOn

Press:

- 2nd FORMAT to access the graph format menu
- Use arrows and ENTER to select ExprOn

TI-83/84/+/SE

2 bytes

The `ExprOn` command enables a "long" form of displaying the equation or plot being traced.

In this mode, when tracing an equation, the equation's name and its formula are written in small font at the top of the screen. For example, when tracing Y_{1} which is equal to 2X, "Y1=2X" will be displayed.

When tracing a plot, the plot number is written, followed by the list or lists that it describes. For example, when tracing Plot1, which is a scatter plot of ∟X and ∟Y, "P1:X,Y" will be displayed.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/expron

The Fcdf( Command

Calculates the *F*-distribution probability betwen *lower* and *upper* for specified numerator and denominator degrees of freedom.

Fcdf(*lower*, *upper*, *numerator df*, *denominator df*

Press:

- 2ND DISTR to access the distribution menu
- 9 to select Fcdf(, or use arrows.

Press 0 instead of 9 on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE

2 bytes

`Fcdf(` is the *F*-distribution cumulative density function. If some random variable follows this distribution, you can use this command to find the probability that this variable will fall in the interval you supply.

The arguments *lower* and *upper* express the interval you're interested in. The arguments *numerator df* and *denominator df*, often written *d _{1}* and

*d*, specify the

_{2}*F*-distribution, written as

`F(`

*d*,

_{1}*d*

_{2}`)`.

# Advanced

Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity.

# Formulas

As with other continuous distributions, `Fcdf(` can be expressed in terms of the probability density function:

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fcdf

The ►F◄►D Command

Converts a number between fraction form and decimal form.

*number*►F◄►D

Press:

- MATH
- RIGHT to NUM
- ALPHA B

Alternatively, access the catalog.

TI-84 2.53MP only

2 bytes

The `►F◄►D` command is used to convert a number from fraction form to decimal form, or vice versa. Regardless of what form the given number is, this command is meant to automatically determine the form so that it returns the other. It is in essence a combination of the `►Frac` and `►Dec` commands, applying `►Frac` if the input is in decimal form and `►Dec` if it is a fraction.

```
7.5►F◄ ►D
15/2
Ans►F◄ ►D
7.5
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/f-d

The Fill( Command

Fills a list or matrix with one number.

Fill(*value*,*matrix*)

Press:

- 2nd LIST to access the list menu.
- RIGHT to access the OPS submenu.
- 4 to select Fill(, or use arrows.

Alternatively, press:

- MATRX (83) or 2nd MATRX (83+ or higher) to access the matrix menu.
- RIGHT to access the MATH submenu.
- 4 to select Fill(, or use arrows.

TI-83/84/+/SE

1 byte

The `Fill(` command takes an existing list or matrix variable and sets all its elements to a single number. It doesn't return anything and only works on already defined variables.

```
{5}→dim(L1)
Fill(2,L1)
L1
{2 2 2 2 2}
{3,4}→dim([A])
Fill(1,[A])
[A]
[[1 1 1 1]
[1 1 1 1]
[1 1 1 1]]
```

`Fill(` is very fast: on a twenty-element real list, it takes only about 3.5 ms, much less than any vectorized list operation.

When `Fill(` is called on a list, the datatype of the list becomes the datatype of the number. That is, `Fill(1,L₁)` makes `L₁` a real list, and `Fill(i,L₁)` makes `L₁` a complex list.

# Optimization

When creating a new list or matrix you want to fill with zeroes, it's better to delete it then create it with `dim(`, which will set all entries to 0, than to set its dimensions with dim( (which may not clear what was there before) then use Fill(.

# Errors

On a TI-84+CSE, using `Fill(List,List)` will cause a RAM clear. For example: `Fill({1,2,3},{1,2,3}` will cause a RAM Clear. This does not apply on any other models, as they only give you argument and data type errors.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fill

The Fix Command

Puts the calculator in fixed-point display mode, displaying *value* digits after the decimal.

Fix *value*

While editing a program, press:

- MODE to access the mode menu.
- Use arrows to select a number 0-9 from the 2nd line.

This will paste Fix *number*. Outside a program, it will simply put the calculator in the appropriate mode.

TI-83/84/+/SE

1 byte

The `Fix` command puts the calculator in fixed-point display mode: all numbers will be displayed with a fixed number of digits (0-9) after the decimal, depending on the argument of `Fix`. This could be useful if you're trying to display potentially fractional numbers in a limited amount of space.

A note on more technical aspects: first, if more digits are available than are displayed, the calculator will round off the displayed number (but not its stored value), so 3.97 will be displayed as 4 in `Fix` 1 mode. Second, the `Fix` command can't force more than 10 significant digits to be displayed, so something like 123456789.1 will only display one decimal digit even in `Fix` 9 mode.

Finally, note that the `Float` and `Fix` commands only change the way numbers are displayed: they are saved in the same way in each case. Even if you're in `Fix` 0 mode, the calculations are not done using integers, and in general, the calculations are still done using floating-point numbers no matter the number mode. The one exception is with regressions: if you store a regression to an equation in `Fix` N mode, it will truncate the numbers involved before storing them to the equation, and as a result, the equation will be different.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fix

The Float Command

Puts the calculator in floating decimal display mode.

Float

Press:

- MODE to access the mode menu.
- Use arrows and ENTER to select Float.

TI-83/84/+/SE

1 byte

The `Float` command makes the calculator display numbers with a "floating decimal point" — only as many digits after the decimal as needed are displayed (so whole numbers, for example, are shown without any decimal points). This is the default mode, and usually the most useful.

A technicality of displaying real numbers on the calculator: A maximum of 14 significant digits are stored in a number, but only 10 of them are actually displayed (or used for comparisons) — the rest are used for additional precision. This means that if a number is displayed as a whole number, it isn't necessarily whole. For example, 1234567890.7 will be displayed as 1234567891 (rounded to 10 significant digits), and 1.0000000003 will be displayed as 1.

This makes sense from many perspectives: if you get a result of 1.0000000003 after a calculation, odds are that this should be 1, and isn't just because of a precision error. Because the extra digits are there, though, even if they're not displayed, such a number will still be invalid for functions such as `Pxl-On(` or `sub(` that want integer arguments, and this sort of error is hard to track down.

Finally, note that the `Float` and `Fix` commands only change the way numbers are displayed: they are saved in the same way in each case. Even if you're in `Fix 0` mode, the calculations are not done using integers, and in general the calculations are still done using floating-point numbers no matter the number mode. The one exception is with regressions: if you store a regression to an equation in Fix N mode, it will truncate the numbers involved before storing them to the equation, and as a result, the equation will be different.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/float

The floor() Command

Returns the floor of a number.

floor(*value*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press 1 to enter the Number submenu.
- Press 6 to select floor(.

This command works on all calculators.

1 byte

The floor() command rounds a number down to the nearest integer less than or equal to the number. For instance, floor(π) returns 3, while floor(-π) returns -4.

The command is an alias for int(): they do the exact same thing. The calculator prefers using floor() (in fact, int() will be converted to floor() in symbolic expressions); int() is left over from earlier calculator models. Other rounding commands include:

- ceiling() — like floor(), but always rounds up (to the next higher integer).
- iPart() — truncates a number to just its integer part (or, if you prefer, rounds a number toward 0).
- round() — rounds to a specific place value, not just to an integer, but round(x,0) will round x to the nearest integer, up or down.

floor() can also be applied to complex numbers, lists, and matrices, rounding everything that there is to round in each of them.

```
:floor(3)
3
:floor({-π,π})
{-4 3}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:floor

The fMax( Command

Calculates the local maximum of a function.

fMax(*f*(*var*),*var*,*lo*,*hi*[,*tol*])

While editing a program, press:

- MATH to open the math menu
- 7 or use arrow keys to select

TI-83/84/+/SE

1 byte

`fMax( f(var),var,lo,hi[,tol])` finds the value of

*var*between

*lo*and

*hi*at which the maximum of

*f*(

*var*) occurs.

*tol*controls the accuracy of the maximum value computed. The default value of

*tol*is 10

^{-5}.

`fMax(` only works for real numbers and expressions. Brent's method for optimization is used for approximating the maximum value.

```
fMax(sin(X)cos(X),X,0,3)
.7853995667
```

Keep in mind that the result is the value of *var*, and not the value of *f(var)*. In this example, .7853995667 is not the highest possible value of sin(X)cos(X), but rather the X-value at which sin(X)cos(X) is the highest.

# Error Conditions

**ERR:BOUND**is thrown if the lower bound is greater than the upper bound.**ERR:DOMAIN**is thrown if*tol*is 0.**ERR:TOL NOT MET**is thrown if the tolerance is too small for this specific function.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fmax

The fMin( Command

Calculates the local minimum of a function.

fMin(*f*(*var*),*var*,*lo*,*hi*[,*tol*])

While editing a program, press:

- MATH to open the math menu
- 6 or use arrow keys to select

TI-83/84/+/SE

1 byte

`fMin( f(var),var,lo,hi[,tol])` finds the value of

*var*between

*lo*and

*hi*at which the minimum of

*f*(

*var*) occurs.

*tol*controls the accuracy of the minimum value computed. The default value of

*tol*is 10

^{-5}.

`fMin(` only works for real numbers and expressions. Brent's method for optimization is used for approximating the minimum value.

```
fMin(cos(sin(X)+Xcos(X)),X,0,2)
1.076873875
```

Keep in mind that the result is the value of *var*, and not the value of *f(var)*. In this example, 1.076873875 is not the lowest possible value of cos(sin(X)+Xcos(X)), but rather the X-value at which cos(sin(X)+Xcos(X)) is the lowest.

# Advanced Uses

`fMin(` is sometimes useful in finding so-called "multiple roots" of a function. If the graph of your function appears "flat" near the root, `fMin(` might be able to find the value of the root more accurately than `solve(`.

# Error Conditions

**ERR:BOUND**is thrown if the lower bound is greater than the upper bound.**ERR:DOMAIN**is thrown if*tol*is 0.**ERR:TOL NOT MET**is thrown if the tolerance is too small for this specific function.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fmin

The fnInt( Command

Approximately computes a definite integral.

fnInt(*f*(*var*),*var*,*a*,*b*[,*tol*])

Press

- Press MATH to access the math menu.
- 9 to select fnInt(, or use arrows.

TI-83/84/+/SE

1 byte

`fnInt( f(var),var,a,b[,tol])` computes an approximation to the definite integral of

*f*with respect to

*var*from

*a*to

*b*.

*tol*controls the accuracy of the integral computed. The default value of

*tol*is 10

^{-5}. fnInt( returns exact results for functions that are polynomials of small degree.

`fnInt(` only works for real numbers and expressions. The Gauss-Kronrod method is used for approximating the integral.

**Tip**: Sometimes, to get an answer of acceptable accuracy out of `fnInt(`, substitution of variables and analytic manipulation may be needed.

```
fnInt(1/X,X,1,2)
.6931471806
fnInt(ln(X),X,0,1) <a difficult example>
-.999998347
fnInt(ln(X),X,0,1,e-11)
-1
```

# Error Conditions

**ERR:DOMAIN**is thrown if*tol*is 0.**ERR:ILLEGAL NEST**is thrown if`fnInt(`occurs in the expression to be integrated.**ERR:TOL NOT MET**may occur if the tolerance is too small.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fnint

The FnOff Command

Turns off equations in the Y= editor (all of them, or only the ones specified)

FnOff [*integer*] [,*integer*]

Press:

- VARS to access the variables menu.
- RIGHT to access the Y-VARS submenu.
- 4 to select On/Off…, or use arrows and ENTER.
- 2 to select FnOff, or use arrows and enter.

TI-83/84/+/SE

1 byte

The `FnOff` command is used to turn off equations in the current graphing mode. When you turn off an equation, it's still defined, but isn't graphed; you can reverse this with the `FnOn` command. To turn functions on and off manually, put your cursor over the = symbol in the equation editor, and press enter.

When `FnOff` is used by itself, it will turn off all defined equations in the current graphing mode. You can also specify which equations to turn off, by writing their numbers after `FnOff`: for example, `FnOff 1` will turn off the first equation, and `FnOff 2,3,4,5` will off turn the second, third, fourth, and fifth. The numbers you give `FnOff` have to be valid equation numbers in the graphing mode. When turning equations on and off in sequence mode, use 1 for `u`, 2 for `v`, and 3 for `w`.

The most common use for `FnOn` and `FnOff` is to disable functions when running a program, so that they won't interfere with what you're doing on the graph screen, then enable them again when you're done.

# Error Conditions

**ERR:DOMAIN**is thrown if an equation number isn't valid in the current graphing mode, or at all.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fnoff

The FnOn Command

Turns on equations in the Y= editor (all of them, or only the ones specified)

FnOn numbers//

Press:

- VARS to access the variables menu.
- RIGHT to access the Y-VARS submenu.
- 4 to select On/Off…, or use arrows and ENTER.
- ENTER to select FnOn.

TI-83/84/+/SE

1 byte

The `FnOn` command is used to turn on equations in the current graphing mode. When you define an equation, it's turned on by default, but the `FnOff` command can turn an equation off (in which case, it's still defined, but isn't graphed). To turn functions on and off manually, put your cursor over the = symbol in the equation editor, and press enter.

When `FnOn` is used by itself, it will turn on all defined equations in the current graphing mode. You can also specify which equations to turn on, by writing their numbers after `FnOn`: for example, `FnOn 1` will turn off the first equation, and `FnOn 2,3,4,5` will turn the second, third, fourth, and fifth. The numbers you give `FnOn` have to be valid equation numbers in the graphing mode. When turning equations on and off in sequence mode, use 1 for `u`, 2 for `v`, and 3 for `w`.

The most common use for `FnOn` and `FnOff` is to disable functions when running a program, so that they won't interfere with what you're doing on the graph screen, then enable them again when you're done.

# Error Conditions

**ERR:DOMAIN**is thrown if an equation number isn't valid in the current graphing mode, or at all.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fnon

The For Command

Repeats a block of code some number of times.

:For *counter*, *start*, *end*, *step*

*(block of code)*

:EndFor

**Menu Location**

Starting in the program editor:

- Press F2 to enter the Control menu.
- Press 4 to paste For..EndFor.

This command works on all calculators.

3 bytes for the For command;

4 bytes for EndFor.

A For..EndFor block is used to repeat the code inside the block some number of times. To specify the number of times to repeat this code, a *counter variable* is specified, along with a starting value and an ending value. The variable will be set to the starting value, then increased until it gets to the ending value, running the code inside the block each time. For example:

```
:For count, 1, 5
: Disp count
:EndFor
1
2
3
4
5
```

You can also give a step size by which to increase the counter (the default is 1). In the above example, if the first line were changed to ":For count, 1, 5, 2" then the block would only run with count=1, then with count=3, then with count=5. You can even make the step size negative and decrease the counter from a maximum to a minimum (e.g. "For count, 5, 1, -1").

For loops are most useful when you want to look at every element of a list or matrix individually. For example, the following code will "do something" (depending on what you replaced the comment with) to every element of "list" in order:

```
:For i, 1, dim(list)
: © do something with list[i]
:EndFor
```

To look at every element of a matrix, you'd have to use two For loops, one inside the other:

```
:For i, 1, rowDim(matrix)
: For j, 1, colDim(matrix)
: © do something with matrix[i, j]
: EndFor
:EndFor
```

# Advanced Uses

The counter variable can be manipulated inside the For loop to produce different results. For example, the following code will count from 1 to 10 but skip 3:

```
:For i, 1, 10
: If i=3
: i+1→i
: Disp i
:EndFor
```

What happens is that when the code runs for the third time, with i=3, the If statement increases i to 4. From there, the For loop thinks it's business as usual, and the next cycle will be done with i=5, then i=6, and so on.

Another way to manipulate the progress of a For loop is with the Cycle and Exit commands (which apply to all loops). You can also use the Goto command to jump out of a For loop, but this is considered poor programming in most cases.

# Optimization

In many cases, the For loop is not the best choice when working with lists — sometimes, the operation can be done on the whole list at the same time, which is both smaller and faster. For example:

```
:For i, 1, dim(list)
: list[i]+1→list[i]
:EndFor
can be
:list+1→list
```

When using For to *create* a list from scratch, the seq() command is a smaller and faster alternative. For example:

```
:For i, 1, 10
: i^2→list[i]
:EndFor
can be
:seq(i^2, i, 1, 10)→list
```

# Error Conditions

**260 - Domain error** happens when the step size is 0.

**730 - Missing start or end of block syntax** happens when the For is missing an EndFor, or vice versa.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:for

The For( Command

Executes some commands many times, with a variable increasing from *start* to *end* by *step*, with the default value *step*=1.

For(*variable*,*start*,*end*[,*step*])

*statement(s)*

End

While editing a program press:

- PRGM to enter the PRGM menu
- 4 to choose For(, or use arrows
- 7 to choose End, or use arrows

TI-83/84/+/SE

1 byte

A `For(` loop is generally used to do something a specific number of times or to go through each one of a bunch of things (such as elements of a list, or the pixels of your screen). Of all the loops, it's the most complicated. The syntax:

```
For(variable,start,end[,step]
statement(s)
End
```

What the loop does:

- Stores
*start*to*variable*. - If
*variable*is greater than*end*(or less than, if*step*is negative), then the`For(`loop ends immediately. - Runs the statement(s).
- Adds
*step*to*variable*and returns to Step 2.

If no value for *step* is given, *step* is assumed to be 1.

In other words: **a For( loop repeats its contents once for every value of variable between start and end**.

This is perhaps best explained with an example. The following code will display the numbers 1 to 10, in order:

```
:For(A,1,10)
:Disp A
:End
```

Now, all of this could be done with a `Repeat` or `While` command and some manipulation, except that this is faster because it's a single command. Still, why have a separate command for something that seems so specific and arbitrary? Well, it's because `For(` has so many uses!

- Do something to each element of a list, matrix, or string.
- Draw several similar objects on the graph screen.
- Create animations.
- Easily add the possibility of levels to many games.
- Any number of other things…

An advanced note: each time the program enters a `For(` loop, the calculator uses 43 bytes of memory to keep track of this. This memory is given back to you as soon as the program reaches `End`. This isn't really a problem unless you're low on RAM, or have a lot of nested `For(` statements. However, if you use `Goto` to jump out of a `For(` loop, you lose those bytes for as long as the program is running—and if you keep doing this, you might easily run out of memory, resulting in ERR:MEMORY.

# Advanced Uses

Sometimes you want to exit out of a `For(` loop when it hasn't finished. You can do this by storing the *end* value to the variable you used in the `For(` loop. For example:

```
:For(A,1,100)
<some code>
:If <condition for exiting out>
:100→A
:End
```

`For(` can also be used to create a delay:

```
//delays for about 0.5 second (83+) or 0.2 second (83+SE/84+/SE/CSE)
:For(A,1,200)
:End
```

If X is

*end*, the delay will be about X/1000 seconds for the TI-83/83+, and X/400 for other calculators.

Unlike delays that use `rand`, a `For(` loop delay can execute an animation or other code during the delay.

`For(` loops can be nested to execute code once for every combination of values of several variables. For example:

```
:For(A,1,50)
:For(B,1,50)
:(some code)
:End
:End
```

This will run (some code) 2500 times—once for every combination of a value of A from 1 to 50 and a value of B from 1 to 50.

There's a standard way to exclude repetitions if the order of the variables doesn't matter (for example, if A=30, B=40 is the same situation as A=40, B=30 in the example above). In this case, the beginning of the loop should be changed to:

```
:For(A,1,50)
:For(B,1,A)
```

On the CSE, a list index can be used as the variable in a `For(` loop. When this is done, the loop will operate and exit normally, but the list will not be affected. For instance, this program

```
:{1,2,3→L₁
:For(L₁(1),2,5
:Disp "X
:End
:Disp L₁
```

will output:

```
X
X
X
X
{1,2,3}
```

# Optimization

The `seq(` command, or simple math, can often be used in place of the `For(` command when dealing with lists. For example:

```
:For(A,1,dim(L1
:cos(A)→L1(A
:End
//can be
:seq(cos(A),A,1,dim(L1→L1
```

and

```
:For(A,1,dim(L1
:1+L1(A→L1(A
:End
//can be
:1+L1→L1
```

One rather strange optimization when using `For(` loops is actually leaving on the ending parenthesis of the `For(` loop in certain cases. If you don't do this, the following cases will be processed **much** slower when they are the first line of code in the loop:

`IS>(`and`DS<(`(no matter if the following command is skipped or not).- A lone
`If`without an accompanying`Then`, but**only**when the condition is false (`If`with a true condition is unchanged).

If the condition of the `If` command can be false (as in most actual cases), you should add a closing parenthesis because the difference is so great.

An example use of this optimization:

```
:For(I,1,1200
:If 0
:1
:End
//should be
:For(I,1,1200)
:If 0
:1
:End
```

# Command Timings

Using a `For(` loop when it fits your purpose is much faster than adapting a `While` or `Repeat` loop to do so. Conclusion: `For(` loops are good!

# Error Conditions

**ERR:INCREMENT**is thrown if the increment of the`For(`loop is 0.**ERR:INVALID**occurs if this statement is used outside a program.**ERR:UNDEFINED**is thrown if you`DelVar`the loop variable while inside the loop.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/for

The format() Command

Converts a number to a string with specified formatting.

format(*number*[,*options*])

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press D to enter the Strings submenu.
- Press 9 to select format(.

This command works on all calculators.

3 bytes

NOTE: Due to the limitations of the wiki markup language, the E command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information.

The format() command is a more advanced version of string() specifically intended to convert numbers (usually, floating-point numbers) to strings. It can override settings like Display Digits and Exponential Format, and instead lets the user input these options and more in a string. Since it converts even integer input to floating-point, it also doesn't depend on the Base setting.

The format string can have the following values (not case-sensitive):

**F**overrides Display Digits to fixed-point with*[number]**[number]*digits after the decimal;*[number]*can be omitted to use the default, which is 12; it must be between 0 and 12.**S**does this and also overrides Exponential Format to scientific.*[number]***E**does this and also overrides Exponential Format to engineering.*[number]***G**does this and also separates the digits to the left of the decimal into groups of three, with*[number][character]**[character]*as the separator. The default for*[character]*, if it is omitted, is a comma. If you make the separator a period, then the decimal point will become a comma.

To all of these, you can also append **R [character]** to replace the decimal point with

*[character]*. Only 'symbols' are allowed for

*[character]*, which is a bit vague: numbers and letters are not allowed, nor are some international characters.

```
:format(π,"F")
"3.14159265359"
:format(2^25,"S6")
"3.355443e7"
:format(2^25,"E6")
"33.55443e6"
:format(2^25,"G0")
"33,554,432."
:format(2^25,"G0 R ")
"33 554 432 "
```

If the format string is empty, or if the argument is omitted entirely, format() will convert the number to a decimal, but otherwise will work just like string()

# Error Conditions

**260 - Domain error** happens when the format string is improperly formatted.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:format

The fPart( Command

Returns the fractional part of a value.

fPart(*value*)

Press:

- MATH to access the math menu.
- RIGHT to access the NUM submenu.
- 4 to select fPart(, or use arrows.

TI-83/84/+/SE

1 byte

fPart(*value*) returns the fractional part of *value*. Also works on complex numbers, lists and matrices.

```
fPart(5.32)
.32
fPart(4/5)
.8
fPart(‾5.32)
‾.32
fPart(‾4/5)
‾.8
```

# Advanced Uses

fPart(, along with int( or iPart(, can be used for integer compression.

Also, fPart( is an easy way to find A mod B (the positive remainder when A is divided by B).

`:B(A<0)+iPart(BfPart(A/B))`

If A is guaranteed to be positive, the following shorter code can be used, omitting B(A<0):

`:iPart(BfPart(A/B))`

Finally, the easiest way to check if a number is a whole number is not(fPart(X:

```
:If not(fPart(X:Then
: // X is an integer
:Else
: // X is not an integer
:End
```

You can use this, for example, to check if a number is divisible by another: if X is divisible by N, then X/N is a whole number. This is useful when you want to find the factors of a number. Warning: when storing values with repeating decimals and later multiplying them to see if a number makes it an integer it can return a value of 1 or -1 instead of 0 even if it is an integer. Example: if you store 1/3 as X and then do fpart(3x) it will return 1 instead of 0. This is because fpart(.999…) results in .999… and then rounds to 1 when displaying rather than rounding to 1.0 and then displaying the fpart( as 0.

# Optimization

Often you want to find the value of a-1 mod b — this occurs, for example, in movement routines with wraparound. However, the problem is that if a=0, a-1 will be negative. Rather than use the longer version of the modulo routine, you might replace subtracting 1 with adding (b-1). This will have the same result, but without sign problems.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fpart

The Fpdf( Command

Evaluates the F-distribution probability density function at a point.

Fpdf(*x*, *numerator df*, *denominator df*)

Press:

- 2ND DISTR to access the distribution menu
- 8 to select Fpdf(, or use arrows.

Press 9 instead of 8 on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE

2 bytes

Fpdf( is the F-distribution probability density function.

Since the F-distribution is continuous, the value of Fpdf( doesn't represent an actual probability - in fact, one of the only uses for this command is to draw a graph of the distribution. You could also use it for various calculus purposes, such as finding inflection points.

The command takes 3 arguments: *x* is the point at which to evaluate the function (when graphing, use X for this argument), *numerator df* and *denominator df* are the numerator degrees of freedom and denominator degrees of freedom respectively (these specify a single Fpdf( curve out of an infinite family).

The F-distribution is used mainly in significance tests of variance.

# Formulas

The value of the Fpdf( is given by

(1)Here, B is the Beta function.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/fpdf

The ►Frac Command

Displays the fractional value of a number

*Decimal*►Frac

While editing a program, press:

- MATH to open the math menu
- ENTER or 1 to select.

TI-83/84/+/SE

1 byte

►Frac attempts to display the input in fraction form. It only works on the home screen outside a program, or with the Disp and Pause commands in a program. It takes up to 12 decimal places of a non-terminating decimal to find the corresponding fraction. The decimal input is returned if ►Frac fails to find the fraction form.

For a better algorithm for finding fractions, see the Decimal to Fraction routine.

```
.333►Frac
.333
.333333333333►Frac
1/3
```

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/frac

The Full Command

Sets the screen mode to FULL.

Full

In the BASIC editor,

- Press [MODE]
- Press [DOWN] seven times
- Press [ENTER] to insert Full

TI-83/84/+/SE

1 byte

The `Full` command cancels the effects of either `Horiz` or `G-T`.

`Full` is usually used either at the beginning and/or ending of a program. It is used at the beginning to ensure that the screen mode is `Full`, the standard setting. It is used at the end if the screen mode was changed in the middle of the program (as clean up).

`:Full`

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/full

The Func Command

Enables function graphing mode.

Func

While editing a program, press:

- MODE to access the mode menu.
- Use arrows to select Func.

TI-83/84/+/SE

1 byte

The Func command enables function graphing mode. This is usually unnecessary in a program, but if you want to graph a Y# equation, you'd want to make sure the calculator is in function mode first.

In function mode, you can graph equations where y (the vertical coordinate) is a function of x (the horizontal coordinate). This mode is most commonly discussed in algebra and single-variable calculus courses. Many curves, such as a parabola, have simple expressions when written in the form y=f(x).

However, in function mode, many expressions cannot be graphed at all. For example, a circle can't be easily graphed in function mode, since for some x-values, there are two y-values. Using two functions, you can achieve a circle, but it will still require a friendly graphing window to display perfectly.

Many calculator features are specifically targeted at function mode graphing. For example, two graphing styles (see GraphStyle() can be only used with function mode. The DrawF command draws a function in graphing mode.

# Advanced Uses

The window variables that apply to function mode are:

**Xmin**— Determines the minimum X-value shown on the screen.**Xmax**— Determines the maximum X-value shown on the screen.**Xscl**— Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode.**Ymin**— Determines the minimum Y-value shown on the screen.**Ymax**— Determines the maximum Y-value shown on the screen.**Yscl**— Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode.**Xres**— Determines the pixel distance between points used for graphing. This is a value 1-8: 1 for best quality, 8 for best speed.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/func

The G Command

Converts an angle to gradians, if necessary.

*angle* ^{G}

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press 2 to enter the Angle submenu.
- Press C to select
^{G}.

This command requires a TI-89 Titanium or Voyage 200 calculator with AMS version 3.10 or higher.

1 byte

NOTE: Due to the limitations of the wiki markup language, the^{G}command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information.

The ^{G} symbol used after an angle makes sure the angle is interpreted as being in gradians (an obscure angle measure in which a full circle is equal to 400 gradians); this functionality is present only on TI-89 Titanium or Voyage 200 calculators with AMS version 3.10. If the calculator is already in gradian mode, x^{G} is equal to x; in degree mode, x^{G} is equal to 9*x/10; and in radian mode, x^{G} is equal to π*x/200.

If you're using gradian angle measures extensively in a program, it's a better idea to use setMode() to switch to gradian mode and not worry about this. However, there are two reasons you might want to use ^{G}:

- If you need an angle in gradians only once or twice, don't bother changing the mode setting.
- In a function, you're forced to use
^{G}, since setMode() isn't valid in a function.

In gradian mode (no conversion is necessary, so no conversion is done):

```
:cos(100)
1
:cos(100^G)
1
:100^G
100
```

In degree mode:

```
:cos(100)
cos(100)
:cos(100^G)
1
:100^G
90
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:gradian

The GarbageCollect Command

Clears up 'garbage' that comes from unarchiving or deleting archived files.

GarbageCollect

This command can only be found in the catalog. Press:

- 2nd CATALOG to access the command catalog
- G to skip to commands starting with G
- ENTER to select GarbageCollect

TI-83+/84+/SE

(not available on the regular TI-83)

2 bytes

A bit of a preamble: unlike RAM, which is the easy-to-access memory, Flash ROM (the archive), used for long-term storage on the 83+ and higher, can't be written to easily. Skipping over technicalities, what's written in the archive once is semi-permanent, and can't be written to again unless an entire 64KB sector of memory is erased.

As a result, when you delete a variable from archive, the calculator doesn't delete it immediately (there may be other, good variables in the same block that would get erased as well), it just marks it as deleted. Similarly, when you unarchive a variable, its data is copied to RAM and the original is marked as deleted.

Naturally, this can't be done forever: sooner or later you'll run out of space in the archive because all of it is taken up by these "garbage variables". At this point, the calculator does something known as "garbage collecting". It copies the actually-used variables in each sector to a backup sector (set aside just for this purpose), then erases it; the process is repeated for the other sectors. Additionally, the variables are rearranged so that they aren't spread out all over the place; this makes it more likely that a spot will be found for large variables.

While "garbage collecting" will be done automatically when it's absolutely necessary, this may be a time-consuming process at that stage. Instead, you can call the `GarbageCollect` command yourself periodically (how often depends on your calculator habits, but generally once a month or so could work) to keep the Flash ROM in a semi-neat state, and then it will be a fairly quick process.

During garbage collection, a menu will appear that asks you "Garbage Collect?", giving you the options No and Yes. If you didn't select the `GarbageCollect` command yourself, it's highly recommended to select Yes. If you did select it, you probably want to garbage collect, so you should also select Yes. At that point, the message "Garbage collecting…" will be displayed for some time, and then the process will end.

# Advanced Uses

To avoid garbage collecting often, reduce the amount of times you archive and unarchive variables. There's also the consideration that too many writes to the Flash ROM (which are directly related to the number of GarbageCollects you do) can, in theory, wear it out. This probably would take much longer than anyone's used a TI-83+ calculator so far, though, and in all probability you don't really have to worry about this.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/garbagecollect

The gcd( Command

Finds the greatest common divisor of two values.

gcd(*value1*, *value2*)

Press:

- MATH to access the math menu.
- RIGHT to access the NUM submenu.
- 9 to select gcd(, or use arrows.

TI-83/84/+/SE

2 bytes

The `gcd(` command returns the greatest common divisor (GCD) of two nonnegative integers. It also works on lists.

```
gcd(8,6)
2
gcd({9,12},6)
{3 6}
gcd({14,12},{6,8})
{2 4}
```

# Advanced Uses

A `gcd(` command can be nested inside another `gcd(` command to compare up to four numbers.

# Error Conditions

**ERR:DIM MISMATCH**is thrown if the arguments are two lists that don't have the same number of elements.**ERR:DOMAIN**is thrown if the arguments aren't positive integers (or lists of positive integers) less than`1E12`.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/gcd

The geometcdf( Command

Calculates the cumulative geometric probability for a single value

geometcdf(*probability*, *trials*)

Press:

- 2ND DISTR to access the distribution menu
- ALPHA E to select geometcdf(, or use arrows.

Press ALPHA F instead of ALPHA E on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE/CSE/CE

2 bytes

This command is used to calculate cumulative geometric probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions:

- A specific event has only two outcomes, which we will call "success" and "failure"
- The event is going to keep happening until a success occurs
- Success or failure is determined randomly with the same probability of success each time the event occurs
- We're interested in the probability that it takes
**at most**a specific amount of trials to get a success.

For example, consider a basketball player that always makes a shot with 1/4 probability. He will keep throwing the ball until he makes a shot. What is the probability that it takes him no more than 4 shots?

- The event here is throwing the ball. A "success", obviously, is making the shot, and a "failure" is missing.
- The event is going to happen until he makes the shot: a success.
- The probability of a success - making a shot - is 1/4
- We're interested in the probability that it takes at most 4 trials to get a success

The syntax here is `geometcdf( probability, trials)`. In this case:

`:geometcdf(1/4,4`

This will give about .684 when you run it, so there's a .684 probability that he'll make a shot within 4 throws.

Note the relationship between `geometpdf(` and `geometcdf(`. Since `geometpdf(` is the probability it will take **exactly** N trials, we can write that `geometcdf(1/4,4) = geometpdf(1/4,1) + geometpdf(1/4,2) + geometpdf(1/4,3) + geometpdf(1/4,4)`.

# Formulas

Going off of the relationship between `geometpdf(` and `geometcdf(`, we can write a formula for `geometcdf(` in terms of `geometpdf(`:

(If you're unfamiliar with sigma notation, $\sum_{i=1}^{n}$ just means "add up the following for all values of i from 1 to n")

However, we can take a shortcut to arrive at a much simpler expression for `geometcdf(`. Consider the opposite probability to the one we're interested in, the probability that it will **not** take "at most N trials", that is, the probability that it will take more than N trials. This means that the first N trials are failures. So `geometcdf(p,N)` = (1 - "probability that the first N trials are failures"), or:

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/geometcdf

The geometpdf( Command

Calculates the geometric probability for a single value

geometpdf(*probability*, *trials*)

Press:

- 2ND DISTR to access the distribution menu
- ALPHA D to select geometpdf(, or use arrows.

Press ALPHA E instead of ALPHA D on a TI-84+/SE with OS 2.30 or higher.

TI-83/84/+/SE/CSE/CE

2 bytes

This command is used to calculate geometric probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions:

- A specific event has only two outcomes, which we will call "success" and "failure"
- The event is going to keep happening until a success occurs
- We're interested in the probability that it takes a specific amount of trials to get a success.

For example, consider a basketball player that always makes a shot with 1/3 probability. He will keep throwing the ball until he makes a shot. What is the probability that it takes him 3 shots?

- The event here is throwing the ball. A "success", obviously, is making the shot, and a "failure" is missing.
- The event is going to happen until he makes the shot: a success.
- The probability of a success - making a shot - is 1/3
- We're interested in the probability that it takes 3 trials to get a success

The syntax here is `geometpdf( probability, trials)`. In this case:

`:geometpdf(1/3,3`

This will give about .148 when you run it, so there's a .148 probability that it will take him 3 shots until he makes one (he'll make it on the 3rd try).

# Formulas

The value of `geometpdf(` is given by the formula

This formula can be intuitively understood: the probability that the first success is the nth trial is the probability of getting a success - $p$ - times the probability of missing it the first n-1 times - $(1-p)^{n-1}$.

For the trivial value of n=0, however, the above formula gives the incorrect value of 1. It should actually be 0, since the first success can never be the 0th trial. However, since you're not likely to ever be interested in this probability, this drawback doesn't really matter.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/geometpdf

The Get( Command

Gets a variable's value from a connected calculator or CBL device.

Get(*variable*)

While editing a program, press:

- PRGM to access the program menu.
- RIGHT to access the I/O menu.
- ALPHA A to select Get(.

TI-83/84/+/SE/CSE/CE*

1 byte

_{*OS 5.1.5 or later}

The `Get(` command is meant for use with the CBL (Calculator Based Laboratory) device, or other compatible devices. When the calculator is connected by a link cable to such a device, `Get( variable)` will read data from the device and store it to

*variable*. Usually, this data is a list, and so you want to

`Get(L₁)`or some other list variable.

# Advanced Uses

In fact, the `Get(` command can also be used for linking two calculators, in which case it functions precisely like `GetCalc(`. This is probably for compatibility with the TI-82, which used `Get(` rather than `GetCalc(` for linking two calculators. However, since this isn't a documented feature (in fact, your TI-83+ manual will insist that `Get(` **cannot** be used in this way), it isn't guaranteed to work with future calculator versions.

# Optimization

Nevertheless, using `Get(` instead of `GetCalc(` will make your program smaller, and probably preserve functionality.

# Norland Robot

The `Get(` command is usually used after a `Send` command to confirm its transmission like this: `Get( var)`. The variable in the parentheses is where the time of the robot's movement is stored. You can display the time moved with a

`Disp`command.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/get

The GetCalc( Command

Gets a variable from another calculator.

GetCalc(*variable*)

(84+ and 84+SE only)

GetCalc(*variable*,*portflag*)

While editing a program, press:

- PRGM to enter the PRGM menu
- RIGHT to enter the I/O menu
- 9 to choose GetCalc(, or use arrows

TI-83/84/+/SE

2 bytes

The GetCalc( command allows you to make multiplayer games, where two calculators communicate with each other across a link cable that is connected between them. The GetCalc( command can only receive one variable from another calculator, and the variable can be any variable (a real, list, matrix, string, etc.). The calculator doesn't exchange variable values when the variable is received, but instead replace the variable of the same name on the receiving calculator.

For the GetCalc( command to work correctly, the sending calculator must be in a preemptible state and it cannot be executing an assembly program. (The sending calculator is the one which is *not* executing the GetCalc( command.) The two main commands that you should use to ensure this are Pause and Menu(; however, any command that is waiting for user input will also work perfectly fine (such as Prompt and Input).

The GetCalc( command behaves a little differently in the older TI-83 models. If the sending calculator is idle with the Pause or Menu( command, it will automatically "press enter" when the receiving calculator executes GetCalc(. This can be frustrating when in a menu, because it prevents the user's opportunity to make a selection.

However, this can make real-time gaming more possible if used in conjunction with the Pause command. When the receiving calculator receives the variable, it could then execute the Pause command, while the sending calculator automatically exits the power-saving state and could then perform the GetCalc( command. All models after the TI-83 do not automatically exit their power-saving states.

# Advanced Uses

The TI-84+ and TI-84+SE will use the USB port if it is connected to a USB cable, otherwise they will use the I/O port. However, you can specify which port you want to use by putting a number after the variable as GetCalc('s second argument: zero to use the USB port if connected to a USB cable, one to use the USB port without checking to see if it's connected, and two to use the I/O port.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/getcalc

The getConfg() Command

Returns a list of calculator configuration info.

getConfg()

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

3 bytes

The getConfg() command returns a list of useful and not-so-useful information about the calculator. Every other entry in the list is a description of the next entry, so it's not too hard to figure out which entry you need if necessary.

The values returned by getConfg() are:

List position | Value | List position | Value |
---|---|---|---|

1 | "Product Name" | 2 | "Advanced Mathematics Software" |

3 | "OS Version" | 4 | "version #, date" |

5 | "Product ID" | 6 | string unique to calculator model |

7 | "ID #" | 8 | string unique to specific calculator |

9 | "Screen Width" | 10 | 160 or 240 |

11 | "Screen Height" | 12 | 100 or 128 |

13 | "Window Width" | 14 | varies (see Note 1.) |

15 | "Window Height" | 16 | varies (see Note 1.) |

17 | "RAM Size" | 18 | depends on model |

19 | "Free RAM" | 20 | varies (see Note 2.) |

21 | "Archive Size" | 22 | depends on model |

23 | "Free Archive" | 24 | varies |

Notes:

- The window width and window height depend on calculator model and on the split screen setting. They're also off by varying amounts. It's best to use one of the other settings to determine calculator type (widescreen or standard), and getMode() to determine split screen status if necessary.
- Even with all variables deleted, Free RAM will be considerably less than RAM Size, due to operating system variables taking up that much of it.

There are several interesting applications for getConfg(). One is compatibility with other calculator models:

- If you want to make graphics compatible, use Screen Width or Screen Height to check if you're on a widescreen calculator.
- If you want to use an advanced OS feature, check the OS Version.
- If you use lots of features of your calculator model and think it won't work on any other, check Product ID and exit if it doesn't match your own.

Another application: if your program is very memory-intensive, you might want to make sure that there is enough free RAM to fit all the variables you will need. The same is, in theory, true for the archive, but having little archive memory available is rare.

Using the ID #, you might detect when the program has been transferred to a different calculator, and react accordingly (e.g. re-initialize certain variables). A more subtle application: supplying a number calculated from the ID # as the random number seed will ensure that your program always behaves in the same way for the same calculator, but will be different on different calculators — this might be completely inappropriate in some cases, but an interesting gimmick in others!

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getconfg

The getDate() command

Returns the current date set on the calculator and returns it in list format.

getDate()

**Menu Location**

This command can't be found in any menu besides the command catalog.

3 bytes

The getDate() command checks the date that the calculator is set to, and then returns it in a list format. The list will always be in the format {year, month, day}. To change this list to another format, you can use the closely related getDtStr() option, which just returns the date in a string format, not as a list. The setDtFmt() command does not work on this command, but it will change the format that the calculator returns the getDtStr() command as.

For example, if the calculator's date was set to March 14th, 2011, the getDate() command would return the following:

```
:getDate()
: {2011 3 14}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getdate

The getDate Command

Returns a list with the current date that the clock has on the TI-84+/SE.

getDate→*Variable*

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- g to skip to commands starting with G
- Scroll down to getDate and select it

TI-84+/SE

2 bytes

The getDate command returns the current date that the clock has on the TI-84+/SE calculators in list format — {*year*, *month*, *day*}. You can store this list to a variable for later use, or manipulate it the same way you do with other lists. Of course, this command only works if the date has actually been set, so you should use the setDate( command before using it.

An interesting note about this command is that you cannot use the standard listname(var) to access elements - If you try, it multpilies each element of the clock by the number.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/getdate

The getDtFmt Command

Returns the date format of the clock on the TI-84+/SE.

getDtFmt→*Variable*

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- g to skip to commands starting with G
- Scroll down to getDtFmt( and select it

TI-84+/SE

2 bytes

The getDtFmt( command returns the current date format of the clock on the TI-84+/SE calculators as an integer. There are three different date formats available: 1 (M/D/Y), 2 (D/M/Y), and 3 (Y/M/D). You can store this value to a variable for later use. Of course, this command only works if the date format has actually been set, so you should use the setDtFmt( command before using it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/getdtfmt

The getDtFmt() Command

Returns the current default date format.

getDtFmt()

**Menu Location**

This command can't be found in any menu besides the command catalog.

3 bytes

The getDtFmt() returns the number of the current default date format for getDtStr() (that is, the format that getDtStr() with no parameters will use). This same format is also used to display the time in the corner of the Apps Desktop.

The eight formats are as follows (dd, mm, and yy are the date, month, and year respectively, in two digits)

Format Number | Date Format |
---|---|

1 | "mm/dd/yy" |

2 | "dd/mm/yy" |

3 | "mm.dd.yy" |

4 | "dd.mm.yy" |

5 | "yy.mm.dd" |

6 | "mm-dd-yy" |

7 | "dd-mm-yy" |

8 | "yy-mm-dd" |

In a program, it's usually unnecessary to use getDtFmt(). Most of the time, you'll just use getDtStr() with a format already specified; in the rare exceptions where you need to use getDtStr() a lot with the same format, you'd use setDtFmt() to pick the format you want, save the result, and use it to restore the date format at the end of the program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getdtfmt

The getDtStr( Command

Returns the current date of the clock on the TI-84+/SE as a string.

getDtStr(*value*)→*variable*

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- g to skip to commands starting with G
- Scroll down to getDtStr( and select it

TI-84+/SE

2 bytes

The getDtStr( command returns the current date of the clock on the TI-84+/SE calculators as a string based on the date format that is specified. There are three different date formats available: 1 (M/D/Y), 2 (D/M/Y), or 3 (Y/M/D). You can store this value to a string variable for later use, or manipulate it the same way you do with other strings. Of course, this command only works if the date format has actually been set, so you shold use the setDtFmt( command before using it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/getdtstr

The getDtStr() Command

Returns the current date in a string.

getDtStr([*format*])

**Menu Location**

This command can't be found in any menu besides the command catalog.

3 bytes

The getDtStr() command returns the current date in a string. The date can be in one of eight formats, numbered from 1 to 8. This format can be given to getDtStr() directly: for instance, getDtStr(5) will return the date in the fifth format. Or, you can set a default format with the setDtFmt() command, and getDtStr() will use that format when it's not given a specific format to use.

The eight formats are as follows (dd, mm, and yy are the date, month, and year respectively, in two digits)

Format Number | Result of getDtStr() |
---|---|

1 | "mm/dd/yy" |

2 | "dd/mm/yy" |

3 | "mm.dd.yy" |

4 | "dd.mm.yy" |

5 | "yy.mm.dd" |

6 | "mm-dd-yy" |

7 | "dd-mm-yy" |

8 | "yy-mm-dd" |

Formats 5 and 8 are useful in that if you store dates in either of those format, sorting the strings will sort the dates in chronological order.

# Error Conditions

**40 - Argument error** happens when the date format given is not an integer 1-8.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getdtstr

The getKey Command

Returns the numerical code of the last key pressed, or 0 if no key is pressed.

getKey[→*Variable*]

While editing a program, press:

- PRGM to enter the PRGM menu
- RIGHT to enter the I/O menu
- 7 to choose getKey or use arrows

TI-83/84/+/SE

1 byte

The `getKey` command returns the value of the last key pressed since the last time `getKey` was executed. Reading key presses with `getKey` allows a program to transfer control to the user, and you can combine `getKey` with other commands to create menus, movement, or whatever else you want.

Every key has a number assigned to it, except for ON (which is used for breaking out of programs). The numbering system consists of a row and column: the rows go from one to ten, starting at the top; and the columns go from one to six, starting from the left. You just put the row and column together to get the key's number — for example, the ENTER key is located in row 10, column 5, making its value 105. The arrow keys look like they would be numbered separately from the other keys, but they actually follow this pattern as well. See the key codes page for a picture of the key codes on the calculator.

The value of `getKey` is cleared every time you read from it, until a new key is pressed. For this reason, except in very rare cases, you do not want to use the value of `getKey` in an expression directly, but store it to a variable first. It is also common to use `getKey` inside of a `Repeat` loop, so that the program can wait for the user to press a key.

```
:Repeat Ans
:getKey
:End
:Ans→K
```

# Advanced Uses

You can put `getKey` in the condition of a loop, to make the loop repeat until any key or a particular key is pressed by the user. The same thing can be done with conditionals as well. This is useful if you don't want to store `getKey` to a variable, but you still want to have the user press a key. This works because of the way 'true' and 'false' get interpreted in TI-Basic.

```
:Repeat max(getKey={24,25,26,34
:End
```

Unlike the other keys, the arrow and DEL keys can actually be held down, which will cause the key to keep being repeated until it is unpressed. This functionality is very useful in games where the user needs to repeatedly press a key to move or shoot, although it does completely disable the other keys from being able to be pressed (which is important in multiplayer games, where everybody must share the keys).

Sometimes your program may do something for several seconds without user input (say, playing an animation), then pause and wait for a key to be pressed. The problem is that if a key is pressed during the animation, the next `getKey` will return the value of that key, and any loop set up to wait for a key press will exit immediately. The solution is to run a "dummy" `getKey` just before the loop begins — its value won't be used for anything, and it will reset the value of `getKey` to 0. This can also be used to clear keypresses meant for loading programs from inside a shell.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/getkey

The getKey() Command

Returns the last keypress.

getKey()

**Menu Location**

Starting from the program editor:

- Press F3 to enter the I/O menu.
- Press 7 to paste getKey().

This command works on all calculators.

3 bytes

The getKey() command returns the key code of the last keypress. If no key was pressed since the program, function, or expression started running, or since the last getKey() command, getKey() returns 0. It's important to note that once getKey() is used, the keypress is forgotten — even if it's used in the same line! So most of the time you want to store the result of getkey to a variable to use it.

The keypresses that getKey() deals with factor in modifier keys, such as 2nd or alpha. Because of this, it will not respond to the modifier keys pressed by themselves.

This example code using getKey() is commonly used in programs that wait for the user to press a key:

```
:0→key
:While key=0
: getKey()→key
:EndWhile
```

# Advanced Uses

Although the key codes are given in a table on this website, and are listed in your manual, it may be more convenient to write a short function to return key codes for you:

```
:keycode()
:Func
:Local k
:0→k
:While k=0
: getKey()→k
:EndWhile
:k
:EndFunc
```

If you run the function keycode(), it will wait for you to press a key. When you press it, it will return the key code. This function may also be a convenient subroutine in a program that requires waiting for a key in several different places.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getkey

The getMode() Command

Checks the current mode settings.

getMode(*setting*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The getMode() command checks any one current mode setting. Just give it the name of the mode setting to check, as a string, and it will give you the current value. For example:

```
:getMode("Angle")
"RADIAN"
:getMode("Complex Format")
"REAL"
```

The name of the setting is not case-sensitive, but is very typo-sensitive.

In practice, getMode() is almost entirely superseded by setMode() — usually, you don't care about a setting unless you want to change it if it's wrong. In particular, it is silly to do the following:

```
:If getMode("Angle")≠"RADIAN"
: setMode("Angle","RADIAN")
```

In this case, just the setMode() command instruction by itself would have been fine, since changing the mode from radian to radian would've done nothing anyway.

It is *also* silly to do the following:

```
:getMode("Angle")→oldmode
:setMode("Angle","RADIAN")
...
:setMode("Angle",oldmode)
```

It is a noble impulse to try to preserve the old setting and restore it later. However, the same is accomplished more elegantly with (note the { } brackets):

```
:setMode({"Angle","RADIAN"})→oldmode
...
:setMode(oldmode)
```

# Optimization

Every string like "Angle" or "FLOAT 12" can be replaced by a numerical equivalent (one that is, for some reason, still given as a string, e.g. "3" or "26"). Using these is shorter, and it has the benefit of being international.

See the Table of Mode Settings to look up these numbers, as well as read about what the various mode settings do.

# Error Conditions

**260 - Domain error** happens when a mode setting or value doesn't exist, at least not with this spelling.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getmode

The getNum() Command

Returns the numerator of a fraction or given expression

getNum(*expression1*)

**Menu Location**

[MATH][9][B][1]

This command works on all calculators.

X byte(s)

The `getNum()` command return the value of a given expression (an expression being a number or an algebraic expression).

```
getNum(3/5)
3
getNum((x+1)/(x-1))
x+1
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:getnum

The getTime Command

Returns a list with the current time that the clock has on the TI-84+/SE.

getTime→*Variable*

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- g to skip to commands starting with G
- Scroll down to getTime and select it

TI-84+/SE

2 bytes

The getTime command returns the current time that the clock has on the TI-84+/SE calculators in list format — {*hour*, *minute*, *second*}. You can store this list to a variable for later use, or manipulate it the same way you do with other lists. Of course, this command only works if the time has actually been set, so you should use the setTime( command before using it.

An interesting note about this command is that you cannot use the standard listname(var) to access elements - If you try, it multpilies each element of the clock by the number.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/gettime

The getTmFmt Command

Returns the time format of the clock on the TI-84+/SE.

getTmFmt→*Variable*

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- g to skip to commands starting with G
- Scroll down to getTmFmt( and select it

TI-84+/SE

2 bytes

The getTmFmt( command returns the current time format of the clock on the TI-84+/SE calculators as an integer. There are two different time formats available: 12 (12 hour) and 24 (24 hours). You can store this value to a variable for later use. Of course, this command only works if the time format has actually been set, so you shold use the setTmFmt( command before using it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/gettmfmt

The getTmStr( Command

Returns the current time of the clock on the TI-84+/SE as a string.

getTmStr(*value*)→*variable*

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- g to skip to commands starting with G
- Scroll down to getTmStr( and select it

TI-84+/SE

2 bytes

The getTmStr( command returns the current time of the clock on the TI-84+/SE calculators as a string based on the time format that is specified. There are two different time formats available: 12 (12 hour) or 24 (24 hour). You can store this value to a string variable for later use, or manipulate it the same way you do with other strings. Of course, this command only works if the time format has actually been set, so you should use the setTmFmt( command before using it.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/gettmstr

The getType() Command

Returns the variable type of a variable

getType(*variable*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The getType() command returns the type of a variable — number, string, function, etc. The output is a short string encoding the type of the variable.

```
:5→x
:getType(x)
"NUM"
:{1,2,3}→x
:getType(x)
"LIST"
:DelVar x
:getType(x)
"NONE"
```

The specific values that getType() can return are:

- "DATA" for a data variable
- "EXPR" for a symbolic expression
- "FUNC" for a function
- "LIST" for a list
- "MAT" for a matrix
- "NONE" for an undefined variable
- "NUM" for a number
- "OTH" for an unknown variable type (usually assembly-related)
- "PIC" for a picture
- "PRGM" for a program
- "STR" for a string
- "TEXT" for a text file

Keep in mind that getType() cannot test the type of an expression, only a variable — so getType("Hello!") for example is invalid.

# Advanced Uses

If possible, avoid comparing the result of getType() to an actual string. The risk here is that when the calculator is switched to a different language, the output of getType() changes language too. This is only a minor consideration. But if you already *have* a variable of the right type lying around, and you want to test an unknown variable, compare their getTypes(). For example:

```
:{1,2,3}→knownlst
:If getType(unknown)="LST"
can be
:{1,2,3}→knownlst
:If getType(unknown)=getType(knownlst)
```

This is occasionally, but not always, a size optimization as well, if the known variable has a short name.

Since getType() returns a result even for undefined variables, it can be used as a replacement for isVar(), which unlike getType() isn't present on all 68k calculator models.

# Error Conditions

**140 - Argument must be a variable name** happens when the argument is not a variable name.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:gettype

The Goto Command

Jumps to the Lbl instruction with the specified name, and continues running the program from there.

Goto *name*

…

Lbl *name*

While editing a program, press:

- PRGM to enter the PRGM menu.
- 0 to choose Goto, or use arrows.
- 9 to choose Lbl, or use arrows.

TI-83/84/+/SE

1 byte

The `Goto` command is used together with the `Lbl` command to jump (or branch) to another place in a program. When the calculator executes a `Goto` command, it stores the label name in memory, and then searches from the beginning of the program for the `Lbl` command with the supplied name. If it finds it, it continues running the program from that point; otherwise, if the label does not exist, it throws an ERR: LABEL error.

Label names can be either one or two characters long, and the only characters you're allowed to use are letters (including θ) and numbers 0 to 9; this means 37+37*37=1406 possible combinations. Of course, you should use all of the single character names first, before using the two character names. While you can technically have the same label name multiple times in a program, it is rather pointless since the calculator always goes to the first occurrence of the label.

You can position a `Lbl` command one or more lines before a `Goto` command to create a kind of loop structure. However, you have to provide the break-out code, since it isn't built-in. An `If` conditional is easiest, but if there is no code that ends the branching, then program execution will continue indefinitely, until you manually exit it (by pressing the ON key).

```
:Lbl A
:...
:If <exit condition>
:Goto A // this line is skipped
```

Although the `Goto` command may seem like a good alternative to loops, it should be avoided whenever possible, which is especially important when you are first planning a program. This is because it has several serious drawbacks associated with it:

- It is quite slow, and gets slower the further the
`Lbl`is in your program. - It makes reading code (your own, or someone else's) much more confusing.
- In most cases,
`If`,`For(`,`While`, or`Repeat`can be used instead, saving space and improving speed. - Using a
`Goto`to exit any block of code requiring an`End`command causes a memory leak, which will not be usable until the program finishes running or executes a`Return`command, and which will slow down your program down. See below for ways to fix this.

The `Goto` command isn't all bad, however, and is actually useful when a loop isn't practical and when something only happens once or twice (see below for examples). Just remember that you should never use `Goto` to repeat a block of code several times. Use `For(`, `Repeat`, or `While` instead.

# Fixing Memory Leaks

One of the simplest memory leaks that occurs is using branching to exit out of a loop when a certain condition of an `If` conditional is true. If the loop is an infinite loop (i.e., `Repeat` 0 or `While` 1), you should take the condition from the `If` conditional and place it as the condition of the loop. This allows you to remove the branching, since it is now unnecessary.

```
:Repeat 0
:getKey→B
:If B:Goto A
:End:Lbl A
Make Loop Condition
:Repeat B
:getKey→B
:End
```

Of course, the only reason that this memory leak fix is possible is because of the `If` conditional (since the `If` conditional doesn't need a closing `End` command). When dealing with a complex `If` conditional, you will have to rework the conditionals so the branching has its own `If` conditional. Depending on how many commands there are in the conditionals, you might be able to just use an `If` conditional or you might need to use an `If`-`Then` conditional.

```
:If B:Then
:Disp "Hello
:Goto A
:End
Separate Into Conditionals
:If B:Disp "Hello
:If B:Goto A
```

This memory leak fix will work most of the time, but it isn't applicable when one of the values of the variables in the condition is changed by one of the commands inside the condition. The way to get around this is by using another variable for the `If` conditional that the branching uses. You initialize the variable to zero, assign the variable whatever value you want in the conditional, and then check to see if the variable is equal to that value in the branching conditional.

```
:If A=1:Then
:3→A:4→B
:Goto A
:End
Use Another Variable
:Delvar CIf A=1:Then
:3→A:4→B:π→C
:End
:If C=π
:Goto A
```

# Advanced Uses

If your program requires cleanup after it finishes, but it can exit from several different places, use `Goto` and place a `Lbl` at that point. This saves memory over repeating the cleanup code every time you exit. The usual considerations about `Goto` don't apply here: since you're exiting the program, all memory leaks will be gone anyway, and speed isn't much of an issue for something that only gets done once.

The code looks something like this:

```
:If K=45:Goto Q //user pressed CLEAR
:...
:If L:Goto Q // game over
:...
:Lbl Q
:DelVar L1ClrHome
```

A common situation in programs is when a decision has to be made about where the program execution should go next. The obvious approach would be to use the value of a variable as the label name (i.e., something like `Goto` A, with A being a variable), but that doesn't work because the calculator doesn't interpret the label as a variable. So, the next best approach is to use If conditionals with the different values of the variable:

```
:If not(A:Goto 0
:If A=1:Goto 1
:If A=2:Goto 2
```

Another possible use for `Goto` is in program protection to break a program with an error without letting the user see where it happened. If the label that you want to `Goto` doesn't exist, you'll get a ERR: LABEL error, which doesn't provide a 2:Goto option. So, all you have to do is `Goto` a label that you know doesn't exist.

An alternative method would be to lock the program from being able to be edited. (which you currently cannot do on-calc without a shell) This gives you the possibility to throw whatever error you want! For example, if the user entered something invalid, you can add a blank line with a closing parenthesis, and a syntax error will be thrown, without the 2:Goto option! If you do go this route, be sure to only lock it when you are done editing. It is also good practice to include a text file with the source, as well.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.**ERR:LABEL**is thrown if the corresponding label doesn't exist.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/goto

The Goto Command

Jumps to a label somewhere else in the program.

:Goto *label-name*

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes

The Goto command jumps to a label (declared with the Lbl command) somewhere else in the program — either before or after the Goto, it doesn't matter. The label has to be in the same program as the Goto — you can't jump into another program. If there are several labels with the same name, the Goto command will only find the first.

Virtually everyone critiques the Goto command for being unnecessary and encouraging bad coding habits. The argument is that it makes code hard to read: if you see a 'Goto x' somewhere in the program, you have to search through the entire program to find out where to continue reading. And most of the things that Goto is used for can be done better using commands like If, While, Cycle, etc. TI seems to agree, because they didn't even bother putting Goto and Lbl in the program editor toolbar.

That being said, it is sometimes (very rarely) a good idea to use Goto. A good example is a situation when you need to exit several loops at once (this can't be done with the Exit command, which only exits one loop).

A note for TI-83 series programmers: the issue of memory leaks from improper use of the Goto command does not occur on 68k calculators. The 68k TI-Basic parser doesn't use a stack to keep track of loops and If blocks entered: instead, End statements have a link back to what it is they're matching. This means that nothing special happens if a Goto jumps out of a loop: the calculator doesn't even *know* it's inside a loop except at the end when it has to do the looping.

The 68k calculators have their own bit of unexpected Goto behavior: code like expr("Goto x") will not work. This is because the code that expr( runs is treated as though it were inside its own program, so you can't jump out of that program into the program that it's actually in.

# Optimization

The Cycle and Exit commands perform tasks that you might otherwise use Goto for. By all means, use these command instead if you can: they work much faster, since they don't have to look through the entire program for the label (in fact, they don't have to look at all — they already know where to jump).

# Error Conditions

**500 - Invalid label** happens when the label doesn't exist (in this program).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:goto

The GraphStyle( Command

Sets the graphing style of a graphing equation in the current mode.

GraphStyle(*equation #*, *style #*)

While editing a program, press:

- PRGM to access the programming menu.
- ALPHA H to select GraphStyle(, or use arrows.

TI-83/84/+/SE

2 bytes

The GraphStyle( command allows you to set the graphing style of an equation (line, thick line, dotted line, etc.) from within a program.

Its first argument, *equation #*, is the number of the equation whose graphing style you want to change - this depends on the mode you're in. For example, if you wanted to change the graphing style of Y_{1}, you would need to be in function mode and use the value 1 for this argument. If you wanted to change the graphing style of r_{4}, you would need to be in polar mode and use the value 4.

The second argument is a number from 1 to 7, which translates to a graphing style as follows:

- 1 - a normal line, usually the default graph style.
- 2 - a thick line (three pixels wide).
- 3 - a line, with everything above it shaded (only valid in function mode).
- 4 - a line, with everything below it shaded (only valid in function mode).
- 5 - a path: a line, with a ball moving along it as it is graphed (not valid in sequential mode).
- 6 - animated: a ball moving along the graph (not valid in sequential mode).
- 7 - a dotted line.

Compare this to the effect of Connected or Dot mode. When either of these modes is set, all equations, from all graphing modes, are reverted to line style or dotted line style respectively; furthermore, it becomes the default graph style and clearing an equation will revert it to this graph style. The GraphStyle( command simply overrides these modes temporarily.

# Advanced

In shading modes (3 and 4), the shading style cycles as follows:

- The first function graphed shades using vertical lines one pixel apart
- The second function shades using horizontal lines one pixel apart
- The third function shades using negatively sloping diagonal lines, two pixels apart.
- The fourth function shades using positively sloping diagonal lines, two pixels apart.
- After that, functions will cycle through these four styles in that order.

# Error Conditions

**ERR:DOMAIN**if the*equation #*is not a valid equation number in this mode, or if*style #*is not an integer 1-7.**ERR:INVALID**if the graphing style chosen is not valid for the current graphing mode.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/graphstyle

The GridOff Command

Disables the grid on the graph screen.

GridOff

Press:

- 2nd FORMAT to access the graph format menu.
- Use arrows and ENTER to select GridOff.

TI-83/84/+/SE

2 bytes

The GridOff command disables the grid on the graph screen. This is the default setting. Use GridOn to enable the grid.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/gridoff

The GridOn Command

Enables the grid on the graph screen.

GridOn

Press:

- 2nd FORMAT to access the graph format menu.
- Use arrows and ENTER to select GridOn.

TI-83/84/+/SE

2 bytes

The GridOn command enables a grid on the graph screen (you can disable it again with the GridOff command). How fine or coarse the grid is depends on the Xscl and Yscl variables. Drawing the grid just involves plotting points all the points of the form (A×Xscl, B×Yscl) that are in the graphing window.

# Advanced Uses

GridOn can be used to shade the entire screen if Xscl and Yscl are small enough that the points on the grid are one pixel apart:

```
:ΔX→Xscl
:ΔY→Yscl
:GridOn
```

This is one of the shortest ways to shade the screen, although Shade( can be used for a (usually) even shorter way. However, using GridOn is also very slow: the fastest way involves the Horizontal or the Vertical commands in a For( loop.

You could also use GridOn to draw the playing grid for a Dots and Boxes game.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/gridon

The G-T Command

Sets the screen mode to G-T.

G-T

In the program editor,

- Press [MODE] for the mode menu
- Press [DOWN] seven times (for the split screen commands)
- Press [RIGHT] twice to select G-T
- Press [ENTER] to insert it

This command can be used on the home screen, but must be selected from the catalog.

TI-83/84/+/SE

2 bytes

`G-T` puts the calculator into "Graph-Table" mode: this mode shows the home screen at full size, but the graph screen and table will be displayed together, each taking up half the screen (divided vertically).

`G-T` is usually used at the beginning of a program to ensure that the screen mode is `G-T` , for programs such as math programs that want to demonstrate the thinking step-by-step.

`:G-T`

With OS version 2.30 (on the TI-84+ and TI-84+ SE calculators), `G-T` mode can be used with stat plots as well.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/g-t

The Horiz Command

Sets the screen mode to Horiz.

Horiz

In the program editor,

- Press [MODE]
- Press [DOWN] seven times
- Press [RIGHT]
- Press [ENTER] to insert Horiz

TI-83/84/+/SE

1 byte

`Horiz` is usually at the beginning of a program. It is used at the beginning to ensure that the screen mode is `Horiz`, for programs such as Hangman that want to use `Input` but also have the graph screen shown. Note that if you use pixels, the y-coordinate can be no larger than 30, since that is the maximum pixel's range.

`:Horiz`

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/horiz

The Horizontal Command

Draws a horizontal line on the graph screen.

Horizontal *Y*

In the program editor:

- 2nd DRAW to enter the draw menu
- 3 to insert the Horizontal command, or use arrows and ENTER.

TI-83/84/+/SE

1 byte

Horizontal *Y* draws a vertical line from the left of the graph screen to the right at *Y*. Horizontal is usually only used to replace a line that stretches the entire length of the graph screen, along with its counterpart Vertical.

Horizontal is affected by the window settings, unlike the Pxl- commands.

`:Horizontal 5`

# Advanced Uses

One of the fastest ways to make the entire screen black is by drawing horizontal lines from the bottom of the screen to the top.

```
:For(A,Ymin,Ymax,ΔY
:Horizontal A
:End
```

If working with TI 84+C version calculators, the Horizontal command takes an additional color argument, as shown below:

`Horizontal 5,GRAY`

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/horizontal

The i Command

The mathematical symbol *i*, short for √(-1).

*i*

To enter a complex number:

*real-part*+*imag-part i*

Press 2nd *i* to paste *i*.

TI-83/84/+/SE

1 byte

The *i* symbol is short for √(-1), and is used for complex numbers in algebra and complex analysis. On the calculator, entering *i* will not cause an error, even in Real mode, but operations that result in a complex number (such as taking the square root of a negative number) will. If you're dealing with complex numbers, then, it's best to switch to a+bi or re^θi mode.

# Advanced Uses

By using *i* in a calculation, the calculator switches to complex number mode to do it, even if in Real mode. So √(-1) will throw an ERR:NONREAL ANS, but √(0*i*-1) will not (even though it's the same number). This can be used to force calculations to be done using complex numbers regardless of the mode setting — usually by adding or subtracting 0*i*, although more clever ways can be found.

A good example of this technique is our Quadratic Formula routine.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/i

The identity( Command

Creates an *n* by *n* identity matrix.

identity(*n*)

Press:

- MATRX (on the 83) or 2ND MATRX (83+ or higher) to access the matrix menu.
- LEFT to access the MATH submenu.
- 5 to select identity(, or use arrows.

TI-83/84/+/SE

1 byte

The identity( command generates an identity matrix: that is, a matrix [B] such that for any other matrix [A], [A]*[B]=[A] (if [A] is the right size to make the multiplication valid).

The identity matrix is square (that is, the row dimension equals the column dimension); all of its elements are 0 except for the elements along the main diagonal (the diagonal going from top left to bottom right).

The command itself takes one argument: the size of the matrix, used for both row and column size, that is, identity(*n* creates an *n* by *n* matrix.

```
:dim([A]
:identity(Ans(2→[B]
:[A][B]=[A] // should always return 1, meaning 'true'
```

# Optimization

The identity( command can be used as a quick way to create an empty square matrix: 0identity(*n* will create an *n* by *n* matrix containing only 0 as an element. This is faster and smaller than the dim( and Fill( commands used for the same purpose:

```
:{5,5→dim([A]
:Fill(0,[A]
can be
:0identity(5→[A]
```

# Error Conditions

**ERR:INVALID DIM**occurs if the size is not an integer 1-99. In practice, however, even identity(37 requires more free RAM than the calculator ever has.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/identity

The If Command

Executes a line or block of code when an expression is nonzero.

If *condition*

*statement*

If *condition*

Then

*one or more statements*

End

If *condition*

Then

*statement(s) to run if condition is true*

Else

*statement(s) to run otherwise*

End

While editing a program, press:

- PRGM to enter the PRGM menu
- ENTER or 1 to choose If

TI-83/84/+/SE

1 byte

The If command is crucial to most programs. It allows you to execute code if and only if an expression is not equal to zero. Advanced uses of the If command allow you to execute a different block of code if the check turns out to be false. The simplest form of the command is quite easy to understand:

```
:If (condition)
:statement
```

When the calculator gets to that point in your program, it will check to see if the condition is nonzero. Most expressions you will use with If are called *conditional expressions*; that is, they return 1 if the condition is true and 0 if it is false. "2+2=4", "A=5", and "pxl-Test(R,C)". Therefore, when the condition is true, the expression evaluates to 1 and the statement is run. When the condition is false, the expression evaluates to 0, and the statement is skipped.

# Using Then, Else, and End

When you want more than one line of code to depend on the same condition, use an If:Then block.

```
:If (condition)
:Then
code to execute if true
:End
```

An If:Then block also has an optional Else clause, which is used to execute different code when the condition is false.

```
:If (condition)
:Then
code to execute if true
:Else
code to execute if false
:End
```

# Advanced Uses

If statements can execute and skip other If statements. This leads to odd yet effective constructs like these:

```
:If A
:If B
//Executes if A is false or B is true
```

```
If A:Then
//Executes if A is true
If B:Else
//Executes if A is false or B is false
End
```

# Memory Leaks

Each time the program enters an If-Then block, the calculator uses 35+(size of the condition) bytes of memory to keep track of this. This memory is given back to you as soon as the program reaches End. This isn't really a problem unless you're low on RAM, or have a lot of nested If-Then statements. However, if you use Goto to jump out of such a statement, you lose those bytes for as long as the program is running — and if you keep doing this, you might easily run out of memory, resulting in ERR:MEMORY.

# Optimization

As far as the TI-BASIC interpreter is concerned, a value of 0 is false, and any other value is true. We can use a numerical expression rather than a conditional one in the condition of the If statement in a case like the following:

```
:If A≠0
:Disp "A IS NOT 0
can be
:If A
:Disp "A IS NOT 0
```

When code in a single-line If statement simply changes a variable, it can often be replaced with an equivalent piecewise expression, which will be smaller and faster.

```
:If A=B
:C+2→C
can be
:C+2(A=B→C
```

# Code Timings

Single-line If statements are greatly slowed when they are the first line in For( loops without a closing parenthesis. For example,

```
Very slow
:For(I,1,2000
:If 0:
:End
19 times faster (!)
:For(I,1,2000)
:If 0:
:End
```

# Error Conditions

**ERR:DATA TYPE**occurs if the parameter is complex, even if it's complex in a silly way like 0i.**ERR:INVALID**occurs if this statement is used outside a program.**ERR:SYNTAX**occurs if an If is the last statement in the program, or the last except for one empty line.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/if

The If Command

Sets a condition for a line or several lines to be executed.

If *condition*

:*statement*

:If *condition* Then

…

:EndIf

**Menu Location**

Starting in the program editor:

- Press F2 to enter the Control menu.
- Press 1 to paste If.

This command works on all calculators.

2 bytes for If or If..Then;

2 bytes for Else;

2 bytes for ElseIf..Then;

2 bytes for EndIf.

The If command is the most basic tool in programming. The idea is simple: it checks a condition, and then does something only if the condition is true.

## If by itself

With the simplest use of If, the line after it will be skipped if the condition is false.

In the code below, if x really is 4, then the check x=4 is true, so the program will display "x equals 4". If x is not 4, then the check will be false, so Text "x equals 4" will be skipped. Nothing will be displayed.

```
:If x=4
: Text "x equals 4"
```

## If..Then..EndIf

To have multiple lines of code depend on the same condition, use the If *condition* Then..EndIf syntax. Every line before the EndIf will be skipped if the condition is false.

In the following example, both true→xisfour and Text "x equals 4" depend on the condition x=4.

```
:If x=4 Then
: true→xisfour
: Text "x equals 4"
:EndIf
```

## If..Then..Else..EndIf

Often, you want to do one thing if the condition is true, and another if the condition is false. The way to do this is to insert an Else into the If..EndIf block. Everything between If *condition* Then and Else is what happens when the condition is true. Everything between Else and EndIf is what happens when the condition is false.

Note: the Else command is also used inside Try..EndTry blocks.

In the following example, "x is 4" will be displayed if x=4, and "x is not 4" otherwise.

```
:If x=4 Then
: Text "x is 4"
:Else
: Text "x is not 4"
:EndIf
```

## ElseIf..Then

Finally, you can use ElseIf *condition* Then, inside an If..EndIf block, to consider several conditions at the same time. The way this works is: first the basic If condition is checked. If it's true, then the code just after If runs. If that condition was false, but there's an ElseIf, the ElseIf's condition is checked. If it's true, then the code just after the ElseIf runs. If *that* condition was false too, the program goes on to check the next ElseIf (if there is one), and so forth. You can also include a final Else (optionally) which will only run if no condition is met.

For example:

```
:If x=4 Then
: Text "x is 4"
:ElseIf x=5 Then
: Text "x is 5"
:ElseIf x=6 Then
: Text "x is 6"
:Else
: Text "x is neither 4, 5, nor 6"
:EndIf
```

## Conditions

What kind of conditions are possible? Any command that returns a logical value — true or false — is acceptable. This includes:

- Relational operators: =, ≠, >, ≥, <, and ≤
- Logical operators: and, or, xor, not
- Any advanced test command: pxlTest(), isPrime(), and others.
- A variable that contains one of the values true or false, or a function that returns them.

Of course, these can also be combined: for example, isPrime(x) and x≠2 is a valid condition.

# Optimization

Use If without a Then or EndIf for only one command; use Then and EndIf otherwise.

In addition, the when() command can often replace If.

# Error Conditions

**20 - A test did not resolve to TRUE or FALSE** happens when the condition is indeterminate, or the wrong data type.

**280 - Else and ElseIf invalid outside If..Then block** happens when Else or ElseIf are used outside If..EndIf.

**730 - Missing start or end of block syntax** happens when the If-Thens and EndIfs don't match up correctly.

**740 - Missing Then in the If..EndIf block** happens when a Then is missing.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:if

The imag( Command

Returns the imaginary part of a complex number.

imag(*value*)

Press:

- MATH to access the math menu.
- RIGHT, RIGHT to access the CPX (complex) submenu.
- 3 to select imag(, or use arrows.

TI-83/84/+/SE

2 bytes

imag(*z*) returns the imaginary part of the complex number *z*. If *z* is represented as *x*+i*y* where *x* and *y* are both real, imag(*z*) returns *y*. Also works on a list of complex numbers.

```
imag(3+4i)
4
imag({3+4i,-2i,17})
{4,-2,0}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/imag

The IndpntAsk Command

Doesn't automatically fill in table values for the independent variable.

IndpntAsk

Press:

- 2nd TBLSET to access the table settings menu.
- Use arrows and ENTER to select Ask in the Indpnt: line.

TI-83/84/+/SE

1 byte

With the IndpntAsk setting, the independent variable (X, T, θ, or *n* depending on graphing mode) will not be calculated automatically in the table. Instead, when looking at the table, you must select an entry in the independent variable column, press ENTER, and enter a value. The values entered will also be stored to the TblInput list.

(To access the table, press 2nd TABLE, or use the DispTable command in a program)

The alternative, IndpntAuto, fills in several values starting at TblStart and increasing by ΔTbl, and makes the table scrollable (up and down).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/indpntask

The IndpntAuto Command

Automatically fills in the table values for the independent variable.

IndpntAuto

Press:

- 2nd TBLSET to access the table settings.
- Use arrows to select Auto in the Indpnt line to select IndpntAuto.

TI-83/84/+/SE

1 byte

The IndpntAuto setting sets the independent variable (X, T, θ, or *n* depending on graphing mode) to be filled in automatically in the table (which is accessible by pressing 2nd TABLE, or from a program with the DispTable command).

The values which will be filled in start at the value TblStart and increment by ΔTbl (which can be negative, but not 0). They will also be stored in the list TblInput. All these variables can be accessed through the VARS|6:Table… menu; TblStart and ΔTbl can also be edited in the 2nd TBLSET menu.

The other possibility for this setting is IndpntAsk - if that setting is turned on, you must scroll to the corresponding row in the independent variable column, and enter a value.

# Error Conditions

**ERR:DOMAIN**is thrown if ΔTbl=0.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/indpntauto

The Input Command

Prompts the user to enter a value and then stores the value to the variable.

Displays the graph screen and then the user can move around the cursor.

Input

Input [*"Text"*,]*variable*

While editing a program press:

- PRGM to enter the PRGM menu
- RIGHT to enter the I/O menu
- 1 to choose Input

TI-83/84/+/SE

1 byte

The `Input` command is the other way of getting user input on the home screen (getting user input on the graph screen is only possible with the `getKey` command). The `Input` command asks the user to enter a value for a variable (only one variable can be inputted at a time), waiting until the user enters a value and then presses ENTER. It does not display what variable the user is being asked for, but instead just displays a question mark (?).

Because just displaying a question mark on the screen does not really tell the user what to enter for input or what the input will be used for, the `Input` command has an optional text message that can be either text or a string variable that will be displayed alongside the input.

Only the first sixteen characters of the text message will be shown on the screen (because of the screen dimensions), so the text message should be kept as short as possible (a good goal is twelve characters or less). This is so the value the user inputs can fit on the same line as the text. In the case that the value is too long, it will wrap around to the next line.

```
PROGRAM:INPUT
:"Fruit
:Input "Best "+Ans,Str1
:Input "Worst "+Ans,Str2
:Disp "That's "+Ans+"astic!
```

Input can be used to display every variable just before it requests user input, but some of the variables have to be entered in a certain way. If the variable is a string or a Y= function, the user must put quotes ("") around the value or expression. The user must also put curly braces ({}) around lists with the list elements separated by commas, and square brackets ([]) around matrices with the matrix elements separated by commas and each row individually wrapped with square brackets.

# Advanced Uses

When you just use the `Input` command by itself (without any arguments), the graph screen will be shown and the user can move the cursor around. Program execution will then pause until the user presses ENTER, at which time the coordinates of the cursor will be stored to the respective variables (R and θ for `PolarGC` format, otherwise X and Y).

If a text message is longer than twelve characters or you want to give the user plenty of space to enter a value, you can put a `Disp` command before the `Input` command. You break the text message up and display it in parts. The `Input` command will be displayed one line lower, though, because the `Disp` command automatically creates a new line.

```
:Disp "What is your"
:Input "Name",Str0
```

Normally you can't get a quote character into a string (because quotes are used to identify the beginning and end of the string), but the `Input` command actually allows the user to enter a quote character (") as part of a string. This works without problems, and the quote can even be accessed by the user afterwards.

Because a user-defined list variable doesn't need the `∟` prefixed character before it when referring to the list, you may be only asking the user to input a simple real variable but a list would also be allowed. There is nothing you can really do about this problem, except including the `∟` prefixed character when wanting a list inputted and trying to limit your use of `Input` and `Prompt`.

```
:Input A
should be
:Input ∟A
```

# Optimizations

When you are just using the text message to tell the user what the variable being stored to is, you should use the `Prompt` command instead. And, if there is a list of `Input` commands following the same pattern, you can reduce them to just one `Prompt` command.

```
:Input "A",A
:Input "B",B
Replace with Prompt
:Prompt A,B
```

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/input

The Input Command

Asks for a value to be typed in on the I/O screen.

Input [*prompt*,]*variable*

Input

**Menu Location**

Starting in the program editor:

- Press F3 to enter the I/O menu.
- Press 3 to select Input.

This command works on all calculators.

3 bytes

Input *prompt*, *variable* displays *prompt* (which should be a string) on a new line on the Program I/O screen, then waits for the user to type in an expression on the next line. Whatever is typed in is then stored to *variable*. You can leave out the *prompt* part to just have the prompt be a question mark.

Note that whatever is typed in will be interpreted very literally: you'll need { } brackets to enter a list, quotes to enter a string, and so on. If you do want to enter a string, InputStr is probably a better choice.

Prompt is a special case of Input: Prompt *variable* works just as Input does, with *variable*? (the variable name, and a question mark) as the prompt.

If there's an error (for example, a syntax error) in the line that got typed in, the calculator will display the appropriate error message, and ask for the line to be typed in again: the program will continue running as usual. The calculator can even be turned off while Input is running; when it's turned back on, it will continue waiting for input, and then the program will still continue running.

# Advanced Uses

Another use of Input is without any parameters at all: Input by itself will display a cursor on the graph screen, and wait until a point is selected (the cursor can be moved left and right as usual, and a point is selected by pressing ENTER).

You can find out which point was selected by using the xc and yc system variables (xc is the x-coordinate, and yc is the y-coordinate). The Coordinates graph setting determines other behavior:

- If it's set to RECT, the values of xc and yc will be displayed at the bottom of the screen when the point is being selected.
- If it's set to POLAR, the polar coordinates will be stored to system variables rc and θc (in addition to the regular coordinates). The values of rc and θc will be displayed while the point is being selected.
- If it's set to OFF, no coordinates will be displayed (although xc and yc will still contain the resulting coordinate).

If Input is located inside a Try..EndTry block, and the ON key is pressed, the "Break" error will be caught (one of the only times this happens). If you're a nice person, you can use this to add code to exit quietly (without an error message) when ON is pressed. If you're not a nice person, you can use this to create an infinite loop you can't use ON to break out of.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:input

The InputStr Command

Stores a string to a variable

InputStr *variable*

In the program editor, press [F3][4]

TI 89(T)/92

1 byte or 2 bytes

The InputStr command allows you to input a string to a variable. Since Input doesn't support the storing of strings into variables, you have to use this command to do that. Keep in mind that the inputted variable cannot be the name of a preexisting variable or flash application that is locked, protected, or archived. For example, if you had a program named "a" or "hello", the command wouldn't work because it is already in use.

```
InputStr A
//Here, you would a string to be stored to the variable A
InputStr hello
//This would store the string into the variable "hello".
```

# Related Commands

# Error Conditions

**980 - Variable is locked, protected, or archived** happens when the user attempted to redefine/modify an already defined variable.

# Also See

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:inputstr

The inString( Command

Finds the first occurrence of a search string in a larger string.

inString(*haystack*, *needle*, *starting point*)

This command can only be found in the Catalog. Press:

- 2nd CATALOG to access the command catalog
- I to skip to command starting with I
- scroll down to find inString( and select it

TI-83/84/+/SE

2 bytes

The inString( command searches a string for occurrences of a smaller string (similar to the Find feature on a computer), and returns the first such occurrence.

The *source string* is the string you want to search through; the *search string* is the substring you want to find. inString( will return the index of the first letter of the first occurrence of the search string found, or 0 if the search string is not present. For example:

```
:inString("TI-BASIC","BASIC
4
:inString("TI-BASIC","TI
1
:inString("TI-BASIC","I
2
:inString("TI-BASIC","ELEPHANT
0
```

You can also provide the optional *starting point* argument, 1 by default, that will tell the command where it should start looking. If you provide a value higher than 1 here, the command will skip the beginning of the string. This can be used to find where the search string occurs past the first occurrence. For example:

```
:inString("TI-BASIC","I
2
:inString("TI-BASIC","I",2
2
:inString("TI-BASIC","I",3
7
```

# Advanced Uses

You can use inString( to convert a character to a number. For example:

`:inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",Str1→N`

Assuming Str1 is one character long and contains a capital letter, N will hold a value of 1-26 that corresponds to that letter. This value can then be stored in a real number, list, or matrix, where a character of a string couldn't be stored. To get the character value of the number, you can use the sub( command:

`:sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",N,1→Str1`

Using the *starting point* argument of inString(, you can write a routine to return all occurrences of the search string in the source string:

```
:0→dim(L1
:inString(Str0,Str1
:Repeat not(Ans
:Ans→L1(1+dim(L1
:inString(Str0,Str1,Ans+1
:End
```

If the search string is not found, this routine will return {0} in L1. If it is found, the result will be a list of all the places the string was found.

# Optimization

The inString( command can replace checking if a string is one of a number of values. Just put all the values in a string, one after the other, and try to find the string to be checked in the string of those values:

```
:If Str1="." or Str1=",
can be
:If inString(".,",Str1
```

Be careful, because if Str1 were ".," in the above example, this would also be treated like "." or ",". If this is a problem, you can separate the values you want to check for by a character you know can't be in the string:

```
:If Str1="HELLO" or Str1="HI
can be
:If inString("HELLO,HI",Str1
```

(assuming a comma would never be in Str1, and words like "HELL" or "I" are also impossible)

# Error Conditions

**ERR:DOMAIN**is thrown if*starting point*is not a positive integer (it's okay, though, if it's bigger than the length of the string).

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/instring

The inString() Command

Finds a search string in another string.

inString(*string*, *search-string*,[)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press D to enter the Strings submenu.
- Press 6 to select inString(.

This command works on all calculators.

3 bytes

The inString() command searches for one string inside another, starting from the beginning and going forward. If it finds the string, it returns the position where it finds it. If it doesn't find the string, it returns 0. If the string is there multiple times, it will only find the first one.

Optionally, you can also give inString() a starting position. In that case, it won't find any occurrences of the strings earlier than that position.

```
:inString("Chop shops stock chops.","hops")
7
:inString("Chop shops stock chops.","hops",8)
20
:inString("Chop shops stock chops.","stocks")
0
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:instring

The int( Command

Rounds a value down to the nearest integer.

int(*value*)

Press:

- MATH to access the math menu.
- RIGHT to access the NUM submenu.
- 5 to select int(, or use arrows.

TI-83/84/+/SE

1 byte

int(*value*) is the floor function. It returns the greatest integer less than or equal to *value*. Also works on complex numbers, lists and matrices.

```
int(5.32)
5
int(4/5)
0
int(‾5.32)
‾6
int(‾4/5)
‾1
```

The difference between iPart( and int( is subtle, and many people aren't even aware of it, but it exists. Whereas iPart( always truncates its parameters, simply removing the integer part, int( always rounds down. This means that they return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers. For example, iPart(-5.32) is -5, while int(-5.32) is -6.

Most of the time, however, you're dealing with only positive numbers anyway. In this case, the decision to use iPart( or int( is mostly a matter of preference - some people only use int( because it is shorter, some people use iPart( when there is a corresponding fPart( taken. However, see the Command Timings section.

# Advanced Uses

int(, along with iPart( and fPart(, can be used for integer compression.

# Command Timings

The following table compares the speeds of int and iPart(. Each command was timed over 2000 iterations to find a noticeable difference.

Format | Bars | Pixels | Total |
---|---|---|---|

iPart(1 | 10 | 1 | 81 |

iPart(1.643759 | 10 | 1 | 81 |

int(1 | 8 | 7 | 71 |

int(1.643759 | 10 | 2 | 82 |

Conclusion: Unless there are 6 or more decimals, you should consider using int( because of its speed, but with a lot of decimals, iPart( stays the same so it goes faster.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/int

The int() Command

Returns the floor of a number.

int(*value*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

1 byte

The int() command rounds a number down to the nearest integer less than or equal to the number. For instance, int(π) returns 3, while int(-π) returns -4.

The command is an alias for floor(): they do the exact same thing. The calculator prefers using floor() (in fact, int() will be converted to floor() in symbolic expressions); int() is left over from earlier calculator models. Other rounding commands include:

- ceiling() — like floor(), but always rounds up (to the next higher integer).
- iPart() — truncates a number to just its integer part (or, if you prefer, rounds a number toward 0).
- round() — rounds to a specific place value, not just to an integer, but round(x,0) will round x to the nearest integer, up or down.

int() can also be applied to complex numbers, lists, and matrices, rounding everything that there is to round in each of them.

```
:int(3)
3
:int({-π,π})
{-4 3}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:int

The intDiv() Command

Returns the whole number part of a division.

intDiv(*dividend*,*divisor*)

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

1 byte

The integer division command, intDiv(a,b) returns the whole number portion of a/b: this is equal to iPart(a/b). Although this operation is most useful for dividing whole numbers, this definition works for any number, whole or decimal, real or complex.

```
:intDiv(125,3)
41
:intDiv(-125,3)
-41
:intDiv(125,π)
39
```

# Advanced Uses

The intDiv() command also works for lists and matrices. Used with a list or matrix and a number, intDiv() is applied to the number paired with every element of the list or matrix. Used with two lists or two matrices, which must match in size, intDiv() is applied to matching elements of the list or matrix.

Use intDiv() and remain() for the quotient and remainder results of long division, respectively.

# Optimization

Constructions like iPart(a/b) should be replaced with intDiv(a,b): this is smaller and faster.

# Error Conditions

**240 - Dimension mismatch** happens when two list or matrix arguments don't match in size.

Division by zero does not throw an error; an undefined value is returned instead.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:intdiv

The invNorm( Command

Calculates the inverse of the cumulative normal distribution function.

invNorm(*probability*[,*μ*, *σ*])

Press:

- 2ND DISTR to access the distribution menu
- 3 to select invNorm(, or use arrows.

TI-83/84/+/SE

2 bytes

invNorm( is the inverse of the cumulative normal distribution function: given a probability, it will give you a z-score with that tail probability. The probability argument of invNorm( is between 0 and 1; 0 will give -1E99 instead of negative infinity, and 1 will give 1E99 instead of positive infinity

There are two ways to use invNorm(. With three arguments, the inverse of the cumulative normal distribution for a probability with specified mean and standard deviation is calculated. With one argument, the standard normal distribution is assumed (zero mean and unit standard deviation). For example:

```
for the standard normal distribution
:invNorm(.975
for the normal distribution with mean 10 and std. dev. 2.5
:invNorm(.975,10,2.5
```

# Advanced

This is the only inverse of a probability distribution function available (at least on the TI 83/+/SE calculators), so it makes sense to use it as an approximation for other distributions. Since the normal distribution is a good approximation for a binomial distribution with many trials, we can use invNorm( as an approximation for the nonexistent "invBinom(". The following code gives the number of trials out of N that will succeed with probability X if the probability of any trial succeeding is P (rounded to the nearest whole number):

`:int(.5+invNorm(X,NP,√(NP(1-P`

You can also use invNorm() to approximate the inverse of a t-distribution. Since a normal distribution is a t-distribution with infinite degrees of freedom, this will be an overestimate for probabilities below 1/2, and an underestimate for probabilities above 1/2.

# Formulas

Unlike the normalpdf( and normalcdf( commands, the invNorm( command does not have a closed-form formula. It can however be expressed in terms of the inverse error function:

(1)For the arbitrary normal distribution with mean μ and standard deviation σ:

(2)# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/invnorm

The invT( Command

Calculates the inverse of the cumulative Student's t-distribution function with degrees of freedom ν.

invT(*probability*, *ν*)

Press:

- 2ND DISTR to access the distribution menu
- 4 to select invT(, or use arrows.

TI-84+/SE (OS 2.30 or greater)

2 bytes

invT( is the inverse of the cumulative Student t distribution function: given a probability *p* and a specified degrees of freedom *ν*, it will return the number *x* such that tcdf(-E99,*x*,*ν*) is equal to *p*

```
:invT(.95,24
1.710882023
```

# Advanced

invT( is meant for use with so-called "one-tailed' tests; for two-tailed tests, the proper expression to use (corresponding to the inverse of tcdf(-*x*,*x*,*ν*)) is invT(.5(1+*p*),*ν*)

# Formulas

Unlike the tpdf( and tcdf( commands, the invT( command does not have a closed-form formula. However, it can be expressed in terms of the inverse incomplete beta function.

For one degree of freedom, invT( is expressible in terms of simpler functions:

(1)# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/invt

The iPart( Command

Returns the integer part of a value.

iPart(*value*)

Press:

- MATH to access the math menu.
- RIGHT to access the NUM submenu
- 3 to select iPart(, or use arrows.

TI-83/84/+/SE

1 byte

iPart(*value*) returns the integer part of *value*. Also works on complex numbers, lists and matrices.

```
iPart(5.32)
5
iPart(4/5)
0
iPart(‾5.32)
‾5
iPart(‾4/5)
0
```

The difference between iPart( and int( is subtle, and many people aren't even aware of it, but it exists. Whereas iPart( always truncates its parameters, simply removing the integer part, int( always rounds down. This means that they return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers. For example, iPart(-5.32) is -5, while int(-5.32) is -6.

Most of the time, however, you're dealing with only positive numbers anyway. In this case, the decision to use iPart( or int( is mostly a matter of preference - some people only use int( because it is shorter, some people use iPart( when there is a corresponding fPart( taken. However, see the Command Timings section.

# Advanced Uses

iPart(, along with fPart( and int(, can be used for integer compression.

# Command Timings

The following table compares the speeds of int( and iPart(. Each command was timed over 2000 iterations to find a noticeable difference.

Format | Bars | Pixels | Total |
---|---|---|---|

iPart(1 | 10 | 1 | 81 |

iPart(1.643759 | 10 | 1 | 81 |

int(1 | 8 | 7 | 71 |

int(1.643759 | 10 | 2 | 82 |

Conclusion: Unless there are 6 or more decimals, you should consider using int( because of its speed, but with a lot of decimals, iPart( stays the same so it goes faster.

# Related Commands

# See Also

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/ipart

The iPart() Command

Returns the integer part of a number.

iPart(*value*)

**Menu Location**

- Press 2nd MATH to enter the MATH popup menu.
- Press 1 to enter the Number submenu.
- Press 4 to select iPart(.

This command works on all calculators.

1 byte

The iPart() command returns the integer part of a number (removing all the digits after the decimal). Another way of thinking about it is it rounds a number towards 0: positive numbers get rounded down to an integer, and negative numbers get rounded up to an integer.

There are several other rounding commands available, which work in subtly different ways:

- ceiling() always rounds up to the next higher integer.
- floor() always rounds down to the next lower integer. int() does the same thing as floor().
- round() rounds to any given place value, including to an integer; it rounds up or down, whichever is nearest.

However, iPart() is the only one that has a counterpart fPart() which returns the fractional part of a number. This follows the rule that iPart(x)+fPart(x) always equals x.

Using iPart() on the result of a division — iPart(x/y) — is useful so often that there's a specific command, intDiv(), for doing so.

iPart() can also be applied to complex numbers, lists, and matrices, rounding everything that there is to round in each of them.

```
:iPart(3)
3
:iPart({-π,π})
{-3 3}
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:ipart

The irr( Command

Calculates the Internal Rate of Return of an investment.

irr(*CF0*,*CFList*,[*freq*])

On the TI-83, press:

- 2nd FINANCE to access the finance menu.
- 8 to select irr(, or use arrows and ENTER.

On the TI-83+ or higher, press:

- APPS to access the applications menu.
- 1 or ENTER to select Finance…
- 8 to select irr(, or use arrows and ENTER.

TI-83/84/+/SE

2 bytes

The irr( command finds the Internal Rate of Return of an investment, which is a measure of its efficiency. Its mathematical interpretation is the interest rate for which npv( will return 0 for the same cash flows.

irr( takes three arguments: an initial cash flow (CF0), a list of further cash flows (CFList), and an optional frequency list.

# Advanced Uses

irr( can be used to find a root of a polynomial of any degree, give by a list of its coefficients:

`1+.01irr(0,{list of coefficients})`

However, this method is limited to finding roots greater than 1, and will throw an error (ERR:NO SIGN CHG or ERR:DIVIDE BY 0) if it can't find such roots. By reversing the list of coefficients and taking the reciprocal of the roots found, you could find roots less than 1, but this would still result in errors if such roots don't exist either.

Using solve( to find roots of polynomials is less efficient, but more reliable, since it doesn't throw an error unless there are no roots at all to be found.

# Formulas

Solving for irr( requires solving a polynomial with degree equal to the total number of cash flows. As such, there is no general formula for calculating irr(, though numerical methods are possible for finding an approximate solution.

The polynomial associated with the calculation is:

(1)Here, Irr is the internal rate of return, N is the number of cash flows, and C_{t} is the t ^{th} cash flow.

To the calculator, only roots for which Irr>0 are considered to be viable.

# Error Conditions

**ERR:DIM MISMATCH**is thrown if the frequency list's size doesn't match the cash flow list's size.**ERR:DIVIDE BY 0**is thrown if the solution that is found is Irr=0.**ERR:NO SIGN CHG**is thrown if no positive real solution is found.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/irr

The IS>( Command

Increments a variable by 1 and skips the next command if the variable is greater than the value.

IS>(*variable*,*value*)

*command*

While editing a program, press:

- PRGM to enter the PRGM menu
- A to choose IS>(, or use arrows

TI-83/84/+/SE

1 byte

The increment and skip if greater than command — IS>( — is a specialized conditional command. It is equivalent to an If conditional, except the next command will be skipped when the condition is true and it has a variable update built-in. However, it is not used very often (if anything, it is often misused as a looping command) because of its obscure name and somewhat limited application.

The IS>( command takes two arguments:

- A variable, which is limited only to one of the real variables (A-Z or θ).
- A value, which can be either a number, variable, or expression (a combination of numbers and variables).

When IS>( is executed it adds one to the variable (increments it by one), and compares it to the value. The next command will be skipped if the variable is greater than the value, while the next command will be executed if the variable is less than or equal to the value.

The command IS>(A,B is equivalent to the following code:

```
:A+1→A
:If A≤B
```

Here are the two main cases where the IS>( command is used:

```
:7→A
:IS>(A,6
:Disp "Skipped
```

- Initializes the A variable to 7 and then compares to the value
- 7>6 is true so the display message won't be displayed

```
:1→B
:IS>(B,2
:Disp "Not Skipped
```

- Initializes the B variable to 1 and then compares to the value
- 1>2 is false so the display message will be displayed

Note: In addition to both of these cases, there is also the case where the variable and the value are equal to each other. This case is shown below under the 'Advanced Uses' section because it has some added background that goes with it.

# Advanced Uses

When you want the skipping feature of the IS>( command to always occur, you just have to use the same variable for both the variable and value arguments of the command:

`:IS>(B,B`

An undefined error will occur if the variable and/or value doesn't exist before the IS>( command is used, which happens when the DelVar command is used. Consequently, you should not use DelVar with IS>(.

Similar code can be used as a substitute for B+1→B if you don't want to change Ans:

`:IS>(B,B:`

Note that due to the colon after the line, there will be no statement skipped, so you don't have to worry about that.

# Optimization

Because the IS>( command has the variable update built-in, it is smaller than manually incrementing a variable by one along with using an If conditional.

```
:A+1→A
can be
:IS>(A,0
```

The one caution about this is that if the variable is greater than the value (in this case, '0'), the next command will be skipped. If you don't want the skipping functionality, then you need to make sure that the value is never less than the variable. This is not always possible to do. Also, IS>( is slightly slower than its more normal counterpart.

Related to the example code given, IS>( should always have a command following after it (i.e., it's not the last command in a program) because it will return an error otherwise. If you have no particular code choice, just put an empty line or something meaningless.

# Command Timings

Using IS>( to increment a variable is approximately 25% slower than using code like X+1→X. However, it is faster to use IS>( than to construct an If statement to do the same thing.

Note, however, that a quirk in the For( command (see its Optimizations section) will slow down the IS>( command significantly if a closing parenthesis is not used for the For( statement.

# Error Conditions

**ERR:INVALID**occurs if this statement is used outside a program.**ERR:UNDEFINED**is thrown if the variable to be incremented is not defined.**ERR:SYNTAX**is thrown if there is no next line to skip, or if there is only one next line and it is empty.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/is

The isClkOn() Command

Checks if the hardware clock is turned on.

isClkOn()

**Menu Location**

This command can't be found in any menu besides the command catalog.

3 bytes

The isClkOn() command checks if the calculator's clock (which is used by most time and date commands) is running or stopped. The result of isClkOn() is a truth value — true if the clock is on, and false if the clock is off — which makes it perfect for a condition in commands such as If:

```
:If isClkOn() Then
: Disp "Clock is running."
:Else
: Disp "Clock is stopped."
:EndIf
```

The isClkOn() command, though useful, isn't often called for. For instance, there's no need to check if the clock is on if you're planning to turn it on anyway:

```
:If not isClkOn()
: ClockOn
should just be
:ClockOn
```

One use for isClkOn() is in functions, which aren't allowed to change the global status of the calculator with commands like ClockOn or ClockOff. Instead, you might do the next best thing, and return an error message if the clock is turned off.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:isclkon

The isClockOn Command

Returns whether the clock on the TI-84+/SE is on or off.

isClockOn

This command can only be found in the catalog. Press:

- 2nd CATALOG to enter the command catalog
- i to skip to commands starting with I
- Scroll down to isClockOn and select it

TI-84+/SE

2 bytes

The isClockOn command returns whether the clock on the TI-84+/SE calculators is on or off. Based on Boolean logic, it will return 1 if it is on and 0 if it is not. You can store it to a variable for later use, or use it in conditionals and loops as part of the condition. For example, here is how you would check to see if the clock is on:

```
:If isClockOn
:Then
(code if clock is on)
:Else
(code if clock is off)
:End
```

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/isclockon

The Item Command

Adds an item to a Custom or ToolBar menu.

Item *text* (with Custom)

Item *text*,*label* (with ToolBar)

**Menu Location**

Starting in the program editor:

- Press F3 to enter the I/O menu.
- Press 1 to enter the Dialog submenu.
- Press 8 to select Item.

This command works on all calculators.

3 bytes

The Item command is used in Custom..EndCustm and ToolBar..EndTBar blocks (both of which create toolbar menus) to add an option to one of the tabs. See these commands for more details on how to use it.

Inside a Custom..EndCustm menu, the correct syntax is Item *text* (*text* being a string). This will display *text* for the menu option, and also paste *text* every time the option is selected.

Inside a ToolBar..EndTBar menu, the correct syntax is Item *text*,*label*. This will, as in the previous case, display *text* for the menu option; when the option is selected, the program will resume running from Lbl *label*.

# Error Conditions

**130 - Argument must be a string** happens when the option text isn't a string.

**500 - Invalid label** happens when the label doesn't exist (in this program), when the option is selected.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:item

The LabelOff Command

Disables labels on the X and Y coordinate axes.

LabelOff

Press:

- 2nd FORMAT to access the format menu.
- Use arrows and ENTER to select LabelOff.

TI-83/84/+/SE

2 bytes

The LabelOff setting disables labels on the X and Y coordinate axes. This is unnecessary if you've disabled the axes themselves, since the labels are only displayed when the axes are. To enable the labels, use the reverse setting LabelOn.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/labeloff

The LabelOn Command

Puts labels on the X and Y coordinate axes.

LabelOn

Press:

- 2nd FORMAT to access the format menu.
- Use arrows and ENTER to select LabelOn.

TI-83/84/+/SE

2 bytes

The `LabelOn` setting enables labels on the X and Y coordinate axes. If both `LabelOn`and `AxesOn` are set, the axes will be displayed with an X next to the X (horizontal) axis, and a Y next to the Y (vertical) axis. To disable these labels, use the `LabelOff` setting.

`LabelOn` and `LabelOff` have no effect if the coordinate axes aren't displayed; there's nothing to label.

A somewhat quirky behavior of the X and Y labels is that they aren't saved by `StorePic`. If you save a picture of the graph screen, it records every detail of the way it looks, including equations, drawn elements, axes, grid, everything — but not the labels.

One final comment: okay, so by the way the command works we know it was once *intended* to label the axes. However, the command doesn't actually check where the axes *are*. It puts an "x" slightly above the bottom right corner, and a "y" slightly below the top left. Most of the time, including the default graphing window, that doesn't help you to distinguish the axes in the slightest. And in split-screen mode, as shown in the screenshot, they both seem to label the x-axis. Weird.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/labelon

The Lbl Command

Defines a label for a particular Goto or Menu( to jump to.

Lbl *name*

While editing a program, press:

- PRGM to enter the PRGM menu
- 9 to choose Lbl, or use arrows

TI-83/84/+/SE

1 byte

The Lbl command is used together with the Goto command to jump (or branch) to another place in a program. When the calculator executes a Goto command, it stores the label name in memory, and then searches from the beginning of the program for the Lbl command with the supplied name. If it finds it, it continues running the program from that point; otherwise, if the label does not exist, it throws a ERR: LABEL error.

Label names can be either one or two characters long, and the only characters you're allowed to use are letters (including θ) and numbers 0 to 9; this means 37+37*37=1406 possible combinations. Of course, you should use all of the single character names first, before using the two character names. While you can technically have the same label name multiple times in a program, it is rather pointless since the calculator always goes to the first occurrence of the label.

You can position a Lbl command one or more lines before a Goto command to create a kind of loop structure. However, you have to provide the break-out code, since it isn't built-in. An If conditional is easiest, but if there is no code that ends the branching, then program execution will continue indefinitely, until you manually exit it (by pressing the ON key).

```
:Lbl A
:...
:If <exit condition>
:Goto A // this line is skipped
```

Although the Lbl/Goto loop structure may seem like a good alternative to loops, it should be avoided whenever possible, which is especially important when you are first planning a program. This is because it has several serious drawbacks associated with it:

- It is quite slow, and gets slower the further the Lbl is in your program.
- It makes reading code (your own, or someone else's) much more confusing.
- In most cases, If, For(, While, or Repeat can be used instead, saving space and improving speed.
- Using a Goto to exit any block of code requiring an End command causes a memory leak — around 40 bytes of memory will be rendered useless each time you do it until the program finishes running, which will also slow down your program down.

They aren't all bad, however, and are actually useful when a loop isn't practical and when something only happens once or twice. Just remember that you should never use Goto to repeat a block of code several times. Use For(, Repeat, or While instead.

Labels are also used with the Menu( command. The same considerations apply as with Goto, except that (unless you write a custom menu routine) there's no simple alternative to using labels with Menu(.

# Error Conditions

**ERR:INVALID**is thrown if this statement is used outside a program.**ERR:LABEL**is thrown if the corresponding label doesn't exist.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/lbl

The Lbl Command

Marks a point in the program for use with Goto and Toolbar..EndTBar.

:Lbl *label-name*

**Menu Location**

This command can't be found in any menu besides the command catalog.

This command works on all calculators.

2 bytes (plus 1-10 bytes for label name)

The Lbl command is used to mark a point in the program to which the Goto command or selections from a Toolbar..EndTBar menu can jump. When jumping to a label, the calculator will start searching the program from the beginning to find the label.

The same limitations are imposed on a label name as on a variable name. It's okay to have a label with the same name as a variable, though, this won't cause problems.

You can, theoretically, have labels in the same program with the same name, but only the first one will be used (the calculator will always find it before it finds the others). Labels don't extend beyond a program: you can't jump to a label inside a different program or function.

Also, the code inside an expr() string lives in its own program as far as labels are concerned: if you put a label in it, the main program won't find it; you can't jump out of a routine run with expr() into the main program; finally, you don't have to avoid the label names that the main program uses.

# Error Conditions

**500 - Invalid label** happens when the label name uses an invalid character.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/68k:lbl

The lcm( Command

Finds the least common multiple of two values.

lcm(*value1*, *value2*)

Press:

- MATH to access the math menu.
- RIGHT to access the NUM submenu.
- 8 to select lcm(, or use arrows.

TI-83/84/+/SE

2 bytes

Returns the least common multiple (LCM) of two nonnegative integers; lcm(*a*,*b*) is equivalent to *a**b*/gcd(*a*,*b*). Also works on lists.

```
lcm(8,6)
24
lcm({9,12},6)
{18 12}
lcm({14,12},{6,8})
{42 24}
```

# Error Conditions

**ERR:DIM MISMATCH**is thrown if the arguments are two lists that don't have the same number of elements.**ERR:DOMAIN**is thrown if the arguments aren't positive integers (or lists of positive integers) less than 1e12.

# Related Commands

For the most up-to-date version of this command, see http://tibasicdev.wikidot.com/lcm