EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 164

Radio Shack TRS-80 Model 4
418 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...
DEFSTR
C
the variable referenced
by
the name
C1
is identical to the variable
referenced
by
the name
C1
$.
How
BASIC
Converts Numeric Data
Often your program might ask BASIC to assign one type of constant
to a different type of variable. For example:
Ai.,
=
2.34
In
this example, BASIC must first convert the single-precision constant
2.34 to an integer
in
order to assign it to the integer variable A%.
You might also want to convert one type of variable to a different
type, such as:
A# =
Ai.,
A!
= A#
A!
= A
'X,
The conversion procedures are explained
on
the following pages.
Single
or
double
precision
to
integer
type
BASIC rounds the fractional portion of the
number.~~,
NOTE: The original value must
be
greater than or equal to - 32768,
and less than 32768.
Examples
A
'X,
=
32766.7
assigns A% the value 32767.
A
'X,
=
2.
5D3
assigns A% the value 2500.
AX
=
-123.45678801234578
assigns A% the value
-123.
Ai.,
=
-32768.5
produces
an
Overflow Error (out of integer range).
Integer
to
single
or
double
precision
No error is introduced. The converted value looks like the original
value with zeros to the right of the decimal place.
Examples
A# =
32767
Stores 32767.000000000000
in
A#.
2-36

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals