2.4
Built-in
Function
BASIC
ill!
Function
symbol
Example
Description
Absolute
ABS(X)
A =
ABS
(X) Assigns the absolute value
of
variable I X I
to
vairable A.
value
Example:
A=
ABS (2. 9) -+A=
2.
9
A=
ABS
(-5
. 5) -+A= 5. 5
Sign
SGN(X)
A = SGN (X) Assigns
the
numeric sign
of
variable X
to
variable A.
If
the value
of
X
is
negative,
-1
is
assigned to A;
if
X is 0,
0
is assigned
to
A; and
if
X
is
positive, I is assigned to A.
1
~I
(X>O)
Example: I
is
assigned
to
variable
A=
(X = 0)
A when
A=
SGN (0.4)
(X<O)
is executed.
Integer
INT
(X)
A=
INT
(X) Assigns
the
greatest integer value
to
A which
is
less
than
conver-
or
equal
to
the
value
of
variable X.
si
on
Examples:
A=
INT (3.
87)
-+A= 3
A=
INT (0. 6)
-+A= 0
A=
INT (
-3
. 87)
-+A=
-4
Trigono- SIN (X)
'
A=
SIN (X)
Assigns
the
sine
of
X (where X
is
in radians) to variable A.
metric
If
the value
of
X
is
in degrees,
it
must
be converted
to
functions radians before this function
is
used to obtain the sine. Since
I degree equals
rr/
180 radians, the value in radians is
A=SIN(30 *
PAI(l
/180)
obtained
by
multiplying the
number
of
degrees
by
PAI(l)/
180.
For
example, 30° =
30*
PAI(l)/180
radians. The same
applies
to
the
COS, TAN, and ATN functions.
COS (X)
A=
COS (X)
Assigns
the
cosine
of
X (where X
is
in radians)
to
variable A.
A=
C
OS
(200 *
PAI(l)
/180)
TAN (X)
A=
TAN (X)
Assigns
the
tangent
of
X (where X
is
in radians)
to
A=TAN(Y
)j(
PAI(1)/180)
variable A.
ATN(X)
A=
ATN (X)
Assigns
the
arctangent in radians
of
X (tan-
1
X) to variable
A=l80/PAI(1)
)j(
ATN(X)
A.
The value returned will be in the range from - PI/2 to
PI/2.
Square SQR (X)
A=
SQR (X)
Calculates the square
root
of
X and assigns the result to
root
variable
A.
X must be a positive
number
ot
0.
Exponen-
EXP (X)
A=
EXP (X)
Calculates the value
of
ex
and assigns the result
to
variable
tiation
A.
Common
LOG(X)
A=
LOG (X)
Calculates the common logarithm
of
X (log
10
X) and assigns
logarithm
the result
to
variable A.
Natural
LN
(X)
A = LN (X)
Calculates the natural logarithm
of
X (loge X) and assigns
logarithm
the result
to
variable A.
Ratio
of
PAl (X)
A =
PAl (X)
Assigns the
value
to
variable A which
is
X times the value
circum-
of
PI.
ference to
diameter
Radians
RAD (X)
A=
RAD (X)
Converts the value
of
X (where X is in degrees)
to
radians
and assigns the result to variable A.
----------------------------------------~------
----------
------~--------
71