7/Arithmetic Functions
ModelIII
BASIC
offers a wide variety
of
intrinsic
('
'built-in" )functionsfor
performing arithmetic
and
special operations. The special-operationfunctions are
described in the next chapter.
All
the common mathfunctionsdescribed in this chapterreturn single-precision
values
accurate to
six
decimalplaces.
ABS,
FIX
and
INT
return values whose
precisiondepends
on the precision
of
the argument.
The conversionfunctions
(CINT,
CDBL, etc.) return values whoseprecision depends
on the particularfunction. Trigfunctions use orreturn radians, not degrees. A
radian-degree conversion is given
for
each
of
thefunctions.
Forall thefunctions, the argument mustbe enclosed in parentheses. The argument
may be either a numeric variable, expression or constant.
Functions described in this chapter:
ABS
ATN
CDBL
CINT
ABS(x)
COS
CSNG
EXP
FIX
INT
LOG
RANDOM
RND
SGN
SIN
SQR
TAN
Returns the ahsolutevalue
of
the argument. ABS(X) x for X greater than orequal to
zero, and
ABS(X) = - X for X less than zero.
100 IF ABS(X)<1 E - 6 PRINT
"TOO
SMALL"
ATN(x)
Returns the arctangent (in radians)
of
the argument; thatis,
ATN(X)
returns'
'the
angle whose tangentis
x".
To
getarctangent in degrees, multiply
ATN(X)
by
57.29578.
100Y =ATN(B/C)
7/1