You are here: TI‑Nspire™ CX CAS Reference Guide > Alphabetical Listing > G

G

gcd()

gcd(Number1, Number2) expression

Returns the greatest common divisor of the two arguments. The gcd of two fractions is the gcd of their numerators divided by the lcm of their denominators.

In Auto or Approximate mode, the gcd of fractional floating-point numbers is 1.0.

gcd(List1, List2) list

Returns the greatest common divisors of the corresponding elements in List1 and List2.

gcd(Matrix1, Matrix2) matrix

Returns the greatest common divisors of the corresponding elements in Matrix1 and Matrix2.

geomCdf()

geomCdf(p,lowBound,upBound) number if lowBound and upBound are numbers, list if lowBound and upBound are lists

geomCdf(p,upBound)for P(1XupBound) number if upBound is a number, list if upBound is a list

Computes a cumulative geometric probability from lowBound to upBound with the specified probability of success p.

For P(X upBound), set lowBound = 1.

 

geomPdf()

geomPdf(p,XVal) number if XVal is a number, list if XVal is a list

Computes a probability at XVal, the number of the trial on which the first success occurs, for the discrete geometric distribution with the specified probability of success p.

 

Get 

Get [promptString,] var[statusVar]

Get [promptString,] func(arg1, ...argn)[statusVar]

Programming command: Retrieves a value from a connected TI‑Innovator™ Hub and assigns the value to variable var.

The value must be requested:

In advance, through a Send "READ ..." command.

— or —

By embedding a "READ ..." request as the optional promptString argument. This method lets you use a single command to request the value and retrieve it.

Implicit simplification takes place. For example, a received string of "123" is interpreted as a numeric value. To preserve the string, use GetStr instead of Get.

Example: Request the current value of the hub's built-in light-level sensor. Use Get to retrieve the value and assign it to variable lightval.

Embed the READ request within the Get command.

If you include the optional argument statusVar, it is assigned a value based on the success of the operation. A value of zero means that no data was received.

 

In the second syntax, the func() argument allows a program to store the received string as a function definition. This syntax operates as if the program executed the command:

     Define func(arg1, ...argn) = received string

The program can then use the defined function func().

Note: You can use the Get command within a user-defined program but not within a function.

Note: See also GetStr, here and Send, here.

 

getDenom()

getDenom(Expr1) expression

Transforms the argument into an expression having a reduced common denominator, and then returns its denominator.

getKey()

getKey([0|1]) ⇒ returnString

Description:getKey() - allows a TI-Basic program to get keyboard input - handheld, desktop and emulator on desktop.

Example:

keypressed := getKey() will return a key or an empty string if no key has been pressed. This call will return immediately.
keypressed := getKey(1) will wait till a key is pressed. This call will pause execution of the program till a key is pressed.


Example:

Handling of key presses:

Handheld Device/Emulator Key

Desktop

Return Value

Esc

Esc

"esc"

Touchpad - Top click

n/a

"up"

On

n/a

"home"

 

 

 

Scratchapps

n/a

"scratchpad"

Touchpad - Left click

n/a

"left"

Touchpad - Center click

n/a

"center"

Touchpad - Right click

n/a

"right"

Doc

n/a

"doc"

 

 

 

Tab

Tab

"tab"

Touchpad - Bottom click

Down Arrow

"down"

Menu

n/a

"menu"

 

 

 

Ctrl

Ctrl

no return

Shift

Shift

no return

Var

n/a

"var"

Del

n/a

"del"

 

 

 

=

=

"="

trig

n/a

"trig"

0 through 9

0-9

"0" ... "9"

Templates

n/a

"template"

Catalog

n/a

"cat"

 

 

 

^

^

"^"

X^2

n/a

"square"

/ (division key)

/

"/"

* (multiply key)

*

"*"

e^x

n/a

"exp"

10^x

n/a

"10power"

+

+

"+"

-

-

"-"

 

 

 

(

(

"("

)

)

")"

.

.

"."

(-)

n/a

"-" (negate sign)

Enter

Enter

"enter"

 

 

 

ee

n/a

"E" (scientific notation E)

a - z

a-z

alpha = letter pressed (lower case)

("a" - "z")

shift a-z

shift a-z

alpha = letter pressed

"A" - "Z"

 

 

Note: ctrl-shift works to lock caps

?!

n/a

"?!"

 

 

 

pi

n/a

"pi"

Flag

n/a

no return

 

 

 

,

,

","

Return

n/a

"return"

Space

Space

" " (space)

 

 

 

Inaccessible

Special Character Keys like @,!,^, etc.

The character is returned

n/a

Function Keys

No returned character

n/a

Special desktop control keys

No returned character

Inaccessible

Other desktop keys that are not available on the calculator while getkey() is waiting for a keystroke. ({, },;, :, ...)

Same character you get in Notes (not in a math box)

Note: It is important to note that the presence of getKey() in a program changes how certain events are handled by the system. Some of these are described below.

Terminate program and Handle event - Exactly as if the user were to break out of program by pressing the ON key

"Support" below means - System works as expected - program continues to run.

Event

Device

Desktop - TI-Nspire™ Student Software

Quick Poll

Terminate program, handle event

Same as the handheld (TI-Nspire™ Student Software, TI-Nspire™ Navigator™ NC Teacher Software-only)

Remote file mgmt

 

(Incl. sending 'Exit Press 2 Test' file from another handheld or desktop-handheld)

Terminate program, handle event

Same as the handheld.

(TI-Nspire™ Student Software, TI-Nspire™ Navigator™ NC Teacher Software-only)

End Class

Terminate program, handle event

Support

(TI-Nspire™ Student Software, TI-Nspire™ Navigator™ NC Teacher Software-only)

 

Event

Device

Desktop - TI-Nspire™ All Versions

TI-Innovator™ Hub connect/disconnect

Support - Can successfully issue commands to the TI-Innovator™ Hub. After you exit the program the TI-Innovator™ Hub is still working with the handheld.

Same as the handheld

getLangInfo()

getLangInfo() string

Returns a string that corresponds to the short name of the currently active language. You can, for example, use it in a program or function to determine the current language.

English = “en”
Danish = “da”
German = “de”
Finnish = “fi”
French = “fr”
Italian = “it”
Dutch = “nl”
Belgian Dutch = “nl_BE”
Norwegian = “no”
Portuguese = “pt”
Spanish = “es”
Swedish = “sv”

getLockInfo()

getLockInfo(Var) value

Returns the current locked/unlocked state of variable Var.

value =0: Var is unlocked or does not exist.

value =1: Var is locked and cannot be modified or deleted.

See Lock, here, and unLock, here.

getMode()

getMode(ModeNameInteger) value

getMode(0) list

getMode(ModeNameInteger) returns a value representing the current setting of the ModeNameInteger mode.

getMode(0) returns a list containing number pairs. Each pair consists of a mode integer and a setting integer.

For a listing of the modes and their settings, refer to the table below.

If you save the settings with getMode(0) var, you can use setMode(var) in a function or program to temporarily restore the settings within the execution of the function or program only. See setMode(), here.

Mode
Name

Mode
Integer


Setting Integers

Display Digits

1

1=Float, 2=Float1, 3=Float2, 4=Float3, 5=Float4, 6=Float5, 7=Float6, 8=Float7, 9=Float8, 10=Float9, 11=Float10, 12=Float11, 13=Float12, 14=Fix0, 15=Fix1, 16=Fix2, 17=Fix3, 18=Fix4, 19=Fix5, 20=Fix6, 21=Fix7, 22=Fix8, 23=Fix9, 24=Fix10, 25=Fix11, 26=Fix12

Angle

2

1=Radian, 2=Degree, 3=Gradian

Exponential Format

3

1=Normal, 2=Scientific, 3=Engineering

Real or Complex

4

1=Real, 2=Rectangular, 3=Polar

Auto or Approx.

5

1=Auto, 2=Approximate, 3=Exact

Vector Format

6

1=Rectangular, 2=Cylindrical, 3=Spherical

Base

7

1=Decimal, 2=Hex, 3=Binary

Unit system

8

1=SI, 2=Eng/US

getNum()

getNum(Expr1) expression

Transforms the argument into an expression having a reduced common denominator, and then returns its numerator.

GetStr 

GetStr [promptString,] var[, statusVar]

GetStr [promptString,] func(arg1, ...argn)[statusVar]

Programming command: Operates identically to the Get command, except that the retrieved value is always interpreted as a string. By contrast, the Get command interprets the response as an expression unless it is enclosed in quotation marks ("").

Note: See also Get, here and Send, here.

For examples, see Get.

getType()

getType(var) string

Returns a string that indicates the data type of variable var.

If var has not been defined, returns the string "NONE".

getVarInfo()

getVarInfo() matrix or string

getVarInfo(LibNameString) matrix or string

getVarInfo() returns a matrix of information (variable name, type, library accessibility, and locked/unlocked state) for all variables and library objects defined in the current problem.

If no variables are defined, getVarInfo() returns the string "NONE".

getVarInfo(LibNameString)returns a matrix of information for all library objects defined in library LibNameString. LibNameString must be a string (text enclosed in quotation marks) or a string variable.

If the library LibNameString does not exist, an error occurs.

Note the example, in which the result of getVarInfo() is assigned to variable vs. Attempting to display row 2 or row 3 of vs returns an “Invalid list or matrix” error because at least one of elements in those rows (variable b, for example) revaluates to a matrix.

This error could also occur when using Ans to reevaluate a getVarInfo() result.

The system gives the above error because the current version of the software does not support a generalized matrix structure where an element of a matrix can be either a matrix or a list.

Goto

Goto labelName

Transfers control to the label labelName.

labelName must be defined in the same function using a Lbl instruction.

Note for entering the example: For instructions on entering multi-line program and function definitions, refer to the Calculator section of your product guidebook.

Grad

Expr1Grad expression

Converts Expr1 to gradian angle measure.

Note: You can insert this operator from the computer keyboard by typing @>Grad.

In Degree angle mode:


In Radian angle mode: