The same answer appears for each example as soon as you press
. The spacing in math problems is unimportant to the com-
puter. Try out problems of your own. Make long problems that com-
bine subtraction and addition functions.
The multiplication sign—the asterisk (*)—is located on the Right
Arrow key . The division sign is the slash ( / ) on the Question Mark
key . Type the following statements:
PRINT 2 * 2
PRINT (2*2)
PRINT 6 / 3
PRINT (6/3)
The computer not only understands the use of parentheses in math
problems but needs them when the problems become complex. Notice
what happens in this problem with and without parentheses:
PRINT 3* (2+2)
PRINT 3 * 2 + 2
The answer to the first problem is 12; the answer to the second prob-
lem is 8. In the first problem, the computer first adds 2 and 2, then
multiplies by 3 to arrive at 12. In the second problem, the computer
multiplies 3 and 2 first, then adds 2 to arrive at 8. Whenever the com-
puter encounters parentheses in a math problem, it does the computa
tions inside the parentheses first and then finishes the rest of the
calculations.
Try out the problems below to discover some other interesting facts
about how your computer works. See if you can predict the answers
before you press :
PRINT (2+2)*3
PRINT 2+2*3
In the first problem, the computer does the computation inside the
parentheses first. In the second problem, the computer does the
multiplication first, then the addition. The computer executes these
mathematical functions according to rules of order: first, computations
inside parentheses; second, exponential functions; third, multiplication
and division functions as they appear in the problem from left to right;
and last, addition and subtraction functions from left to right. The rules
are summarized in the following table:
49
Summary of Contents for 65XE
Page 1: ...ATARI 65XE PERSONAL COMPUTER OWNER S MANUAL TM...
Page 3: ...ATARI 65XE PERSONAL COMPUTER TM...
Page 6: ...Part 1 GettingStarted 1...
Page 9: ...4...
Page 23: ...18...
Page 25: ...20...
Page 32: ...Part 2 Programming withATARI BASIC 27...
Page 33: ...28...
Page 59: ...54...
Page 69: ...64...
Page 82: ...Part3 Appendices 77...
Page 83: ...78...
Page 97: ...92...
Page 105: ...100...
Page 125: ...120...
Page 126: ...121 Index...
Page 127: ...122...
Page 134: ...ATARI 1987 Atari Corp All Rights Reserved Printed in Taiwan C072018 001 REV B K l 2 1987...
Page 135: ......