EasyManua.ls Logo

Radio Shack TRS-80 Model 3 - Page 191

Radio Shack TRS-80 Model 3
276 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
EXP(x)
Returns
the'
'natural
exponential"
of
x,
that is eX. This is the inverse
ofthe
LOG
function, so x =
EXP(LOG(X)).
100 PRINT EXP( -
X)
FIX (x)
Returns a truncatedrepresentation
of
the argument. All digits to the right
of
the
decimal
point
are simply choppedoff, so the resultant value is an integer.
For
non-negative
x,
FIX(X)
=
INT(X).
For
negative values
of
X,
FIX(X)
=
INT(X)
+
1.
For
example, FIx(2.2) returns
2,
and
FIX(
- 2.2) returns - 2.
100 Y ABS(A - FIX(A))
This statementgives y the value
of
the fractional portion
of
A.
INT(x)
Returns an integerrepresentation
of
the argument, using the largest whole number
thatis not greater than the argument. Argument is
notlimited to the range - 32768
to
+32767.
The
result is storedinternally as a single-precision whole number.
INT(2.5) returns 2;
INT(
-
2.5)
returns - 3; and INT(l000101.23) returns
1000101.
100Z = INT(A*100 +.5)/100
Gives z the value
of
A rounded to two decimal places (for non-negative A).
LOG(x)
Returns the natural logarithm
of
the argument, that is, loge (argument). This
is
the
inverse
of
the
EXP
function, so X =
LOG
(EXP
(X)).
To
find the logarithm
of
a number
to another base
b, use the formula
LOGb
(X)
=
LOGe(x)/LOGe(b).For
example,
LOG(32767)/LOG(2)
returns the logarithm to base 2
of
32767.
100 PRINT LOG(3.3*X)
1/3

Related product manuals