27
■
The Function Family Members
Introduced
here are
more
functions,
such as SIN (X). Such functions are used with parentheses,
in
which
constants,
variables or arithmetic
expressions
can be placed,
—
Function
BASIC
Symbol
Calculated
Value
Example
Integer
INT (X)
Maximum integer
within X
INT
(3.
1 4) =3
INT (0.55)
=
0
INT (-7.9)
=
-8
Absolute value
ABS
(X)
Absolute value of
X
ABS (2.9)= 2.9
ABS (-5.5)
=5.5
Sign
SGN
(X)
1
if
X
is greater
than
0.
0 if X
is equal to
0.
—
1 if X
is
less than 0.
SGN
(500)= 1
SGN
(0)
=
0
SGN (—3.3)
=
—
1
Exponent function
EXP
(X
)
e*
(e
=
2.7182818)
EXP(1)= 2.7182818
EXP
(0)
=
1
Common
logarithm
LOG
(X)
logio X
Provided
X
is greater
than
0.
LOG (3)
=
0.47712125
Natural logarithm
LN
(X)
logeX
Provided X
is greater
than
0.
LN
(3)
=
1.0986123
Square root
SQR (X)
Vx-
Provided
X
is greater
than
or equal to
0.
SQR
(9)
=
3
SQR
(0)
=
0
This
Is PRINT 2*2 Identical to PRINT 2
t
2?
Well
934
t 2
results in
fractions
of 872355.99, but 934
*
934 results 872356. This is
correct
as
an
arithmetic
expression, but
calculations are done
in
a
limited number
of figures, involving unexpected
errors.
For
example,
2
t
2 is done
using the
formula called a
progression expansion.
2t2=7+Sf?ÿ
...+!?£$£'
This calculation
may
cause
the
computer to
scream.
The computer will produce certain
types
of
errors.
These
errors
are, however
of little concern.