Radio Shack TRS-80 PC-3 Owner's Manual page 141

Table of Contents

Advertisement

[Example 1]
3
2
-
9
=
Successive calculation:
3
(SHIFT)
G
2
8
9
(ENTER)
Independent calculation: 3
(SHIFT)
G
2
(ENTER)
89
(ENTER)
~
-9.E-11
~
9.
~
0.
Even in the IF statement, this difference may cause the program not to work as planned for any successive calculations.
[Example 2]
10 INPUT A
20 IFA'" 2
>
=
9 THEN
50
With A
=
3, 3 '" 2 results in
8.99999999991 E
00.
making an
IF
statement unformulated.
In this case, reprogram the calculation by using variables so that it is independent, as follows:
10 INPUT A
15
B=A"'2
20 IF B>= 9 THEN
50
The result of A '" 2 is substituted for a variable, which is used to formulate con-
ditional expression.
Power calculations are based on log x and lOx, thus tending to cause a difference in the results from those calculated inside
the computer.
A'" B
----+
lOB
logA
When the A is negative, B must be an integer.
141

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents