Remain(), Rename, Request – Texas Instruments TITANIUM TI-89 User Manual

Page 864: Return, 864 appendix a: functions and instructions

Advertising
background image

864

Appendix A: Functions and Instructions

remain()

MATH/Number menu

remain(

expression1

,

expression2

)

expression

remain(

list1

,

list2

)

list

remain(

matrix1

,

matrix2

)

matrix

Returns the remainder of the first argument with
respect to the second argument as defined by the
identities:

remain(x,0)

 x

remain(x,y)

 xì yùiPart(x/y)

remain(7,0)

¸

7

remain(7,3)

¸

1

remain(л 7,3)

¸

л

1

remain(7,ë 3)

¸

1

remain(л 7,л 3)

¸

л

1

remain({12,л 14,16},{9,7,л 5})

¸

{3 0 1}

As a consequence, note that

remain(

ì x,y)

ì

remain(x,y)

. The result is either zero or it has

the same sign as the first argument.

Note: See also

mod()

.

remain([9,л 7;6,4],[4,3;4,л 3])

¸

[

1 л1

2 1

]

Rename

CATALOG

Rename

oldVarName

,

newVarName

Renames the variable

oldVarName

as

newVarName

.

{1,2,3,4}! L1

¸

{1,2,3,4}

Rename L1, list1

¸

Done

list1

¸

{1,2,3,4}

Request

CATALOG

Request

promptString,

,

,

,

var [,alphaOn/Off]

If Request is inside a Dialog...EndDlog construct, it
creates an input box for the user to type in data. If it
is a stand-alone instruction, it creates a dialog box
for this input. In either case, if var contains a string,
it is displayed and highlighted in the input box as a
default choice. promptString must be

{ 20

characters.

This instruction can be stand-alone or part of a
dialog construct.

Request "Enter text",t,1 ¸

The argument turned on alpha-lock in the
above example.

The optional alphaOn/Off argument can be any
expression. If it evaluates to zero, alpha-lock is set
to OFF. If it evaluates to anything other than zero,
alpha-lock is set to ON. If the optional argument is
not used, alpha-lock defaults to ON.

If more than one Request command appears within
a Dialog...EndDlog construct, the first alpha setting
is used and subsequent ones are ignored.

Request “Enter number”,n,0

The argument turned off alpha-lock in the
above example.

Return

CATALOG

Return [

expression

]

Returns

expression

as the result of the function.

Use within a

Func

...

EndFunc

block, or

Prgm

...

EndPrgm

block.

Note: Use

Return

without an argument to exit a

program.

Note: Enter the text as one long line on the
Home screen (without line breaks).

Define factoral(nn)=Func

:local answer,count:1! answer

:For count,1,nn

:answerù count! answer:EndFor

:Return answer:EndFunc

¸

Done

factoral(3)

¸

6

Advertising