Appendix A: Functions and Instructions 799
Func CATALOG
Func
block
EndFunc
Required as the first statement in a multi-statement
function definition.
block
can be either a single statement or a series of
statements separated with the “:” character.
Note:
when()
also can be used to define and graph
piecewise-defined functions.
In function graphing mode, define a piecewise
function:
Define g(x)=Func:If x<0 Then
:Return 3ù cos(x):Else:Return
3ì x:EndIf:EndFunc
¸ Done
Graph g(x)
¸
gcd() MATH/Number menu
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(18,33)
¸ 3
gcd(
list1, list2
) ⇒
list
Returns the greatest common divisors of the
corresponding elements in
list1
and
list2
.
gcd({12,14,16},{9,7,5})
¸
{3 7 1}
gcd(
matrix1, matrix2
) ⇒
matrix
Returns the greatest common divisors of the
corresponding elements in
matrix1
and
matrix2
.
gcd([2,4;6,8],[4,8;12,16])
¸
[
2 4
6 8
]
Get CATALOG
Get
var
Retrieves a CBL 2
é
/CBL™ (Calculator-Based
Laboratory
é
) or CBR
é
(Calculator-Based
Ranger
é
) value from the link port and stores it in
variable
var
.
Program segment:
©
:Send {3,1,ë 1,0}
:For i,1,99
: Get data[i]
: PtOn i,data[i]
:EndFor
©
GetCalc CATALOG
GetCalc
var
Retrieves a value from the link port and stores it in
variable
var
. This is for unit-to-unit linking.
Note: To get a variable to the link port from another
unit, use
2°
on the other unit to select
and send a variable, or do a
SendCalc
on the other
unit.
Program segment:
©
:Disp "Press Enter when ready"
:Pause
:GetCalc L1
:Disp "List L1 received"
©