EasyManua.ls Logo

Commodore 128 - Exponentiation; Multiplication and Division; Order of Operations

Commodore 128
448 pages
Print Icon
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...
Multiplication and Division
Find the asterisk key (*) on the right side of your keyboard. This
is the symbol that the Commodore 128 uses for multiplication.
The slash (/) key, located next to the right SHIFT key, is used for
division.
Try these examples:
PRINT 5*3 RETURN
PRINT 100/2 RETURN
Exponentiation
Exponentiation means to raise a number to a power. The up
arrow key (t), located next to the asterisk on your keyboard, is
used for exponentiation. If you want to raise a number to a power,
use the PRINT command, followed by the number, the up arrow
and the power, in that order. For example, to find out what 3
squared is, type:
p r in t 3T2 nrm m i
Order of Operations
You have seen how you can combine addition and subtraction in
the same PRINT command. If you combine multiplication or
division with addition or subtraction operations, you may not get
the result you expect. For example, type:
PRINT 4 + 6/2 RETURN
If you assumed you were dividing 10 by 2, you were probably
surprised when the computer responded with the answer 7. The
reason you got this answer is that multiplication and division
operations are performed by the computer before addition or
subtraction. Multiplication and division are said to take
precedence over addition and subtraction. It doesnt matter in
what order you type the operation, ln computing, the order in
which mathematical operations are performed is known as the
order of operations.
Exponentiation, or raising a number to a power, takes
precedence over the other four mathematical operations. For
example, if you type:
3-21

Table of Contents

Other manuals for Commodore 128

Related product manuals