BASIC
21 /
Arithmetic
Functions
Model
III BASIC
offers
a
wide variety
of
intrinsic
{
'
'built-in
'
' )
functions
for
performing
arithmetic and
special
operations
.
The special-operation
functions
are
described in the next chapter.
All the common math
functions
described in
this chapter return single-precision
values
accurate to six decimalplaces.
ABS, FIX and INT
return values
whose
precision
depends
on the precision
of
the argument.
The conversionfunctions (CINT, CDBL,
etc.) return values whose precision depends
on the particular
function.
Trigfunctions use
or return radians, not degrees.
A
radian-degree conversion is
given
for
each
of
the
functions
.
For all the
functions
, the argument must
be
enclosed
in parentheses
.
The argument
may
be
either a numeric variable, expression
or constant.
Functions
described
in this chapter:
ABS COS
INT SGN
ATN CSNG
LOG SIN
CDBL
EXP RANDOM SQR
CINT FIX
RND TAN
Returns the absolute value of the
argument. ABS(X)
=
x for x greater than or
equal to
zero
,
and ABS(X)
=
-
x for x less
than zero
.
1 00 IF
ABS(X)<1
E
-
6
PRINT "TOO SMALL"
ATN (x)
Returns the arctangent (in radians)
of
the argument; that is, ATN(X) returns
"the
angle
whose
tangent
is
x"
. To get
arctangent in
degrees,
multiply ATN(X)
by
57.29578.
100Y
=
ATN(B/C)
179