Vector Basic Interpreter Basic 80 Reference Manual - page 18
When necessary, BAS~C will convert a numeric
constant
from
one
type
to
another.
The
following
rules and examples
should be kept in mind.
1.
If a numeric constant of one type is set equal to a
numeric
variable
of
a different type, the number
will be stored as the type declared in the variable
name.
(If
a
string
'variable
is set equal to a
numeric value o~
vice
versa,
a
"Type
mismatch"
error occurs.)
Example:
10 A% • 23.42
20 PRINT At
RON
23
2.
During expression evaluation, all of
the
operands
in
an
arithmetic
or
relational
operation
are
converted to the same degree
of
precision,
i.e.,
that of the most precise operand.
Also, the result
of an arithmetic
operation
is
returned
to
this
degree of precision.
EXamples:
10
ot •
61/7
The arithmetic was performed
20 PRINT Of
in double precision and the
RUN
result was returned in Of
.8571428571428571 as a double precision value.
10 0 =- 6#/7
20 PRINT
0
RON
.857143
The arithmetic was performed
in double precision and the
result was returned to 0 (single
precision variable), rounded and
printed as a single precision
value.
3.
Logical operators
(see Section 1.8.3) convert their
operands
to integers and return an integer result.
Operands must be in the range -32768 to 32767 or an
"Overflow" error occurs.
4.
When a floating point
value
is
converted
to
an
integer, the fractional portion is rounded.
EXample:
10 C'l
:II
55.88
20 PRINT C%
RON
56