EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 112

Radio Shack TRS-80 Model III
274 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...
!
TRS-80 MODEL III
How
BASIC
Stores Data
The way that BASIC stores
data determines the
amount of memory
it will consume
and
the speed in which BASIC
can process it.
Numeric Data
You may get BASIC
to store all numbers in
your program
as either integer,
single
precision, or
double precision
. In deciding
how to get BASIC
to store your
numeric
data, remember
the tradeoffs
.
Integers are
the most efficient
and the least
precise.
Double precision
is the most
precise and least
efficient.
Integers
(Speed
and Efficiency,
Limited Range)
To be stored
as an integer,
a number
must be
whole and in
the range
of
-
32768 to
32767. An
integer value
requires only
two bytes
of memory
for storage.
Arithmetic
operations
are faster
when both
operands are
integers
.
For
example:
1 32000
-2
500
-12345
can
all be stored
as integers.
Single-Precision
Type
(General
Purpose,
Full
Numeric Range)
Single-precision numbers can include up to
7
significant
digits,
and can
represent
normalized values* with exponents
up to ±38, i.e., numbers
in
the range:
[-1 x 10
38
,
-1
x lO'
38
]
[1
x
10'
38
,
1
x 10
38
]
A single-precision
value
requires
4 bytes of memory
for storage.
BASIC assumes
a
number
is
single-precision
if
you do not specify
the level
of precision.
*In this
reference manual,
normalized
value is
one in which
exactly
one digit
appears to
the left of
the decimal
point. For
example, 12.3
expressed
in normalized
form
is 1.23
x 10.
102

Other manuals for Radio Shack TRS-80 Model III

Related product manuals