Commodore 16 User Manual page 29

Hide thumbs Also See for Commodore 16:
Table of Contents

Advertisement

INTRODUCTION
You Cont have to be a mathematics genius to understand and make
use of the mathematics capabilities of your Commodore 16. In addition
Co the straight-forward operations like addition, subtraction.
multiplication and division, you can use your computer to figure out
advanced functions like square roots and sines. you'll learn about the
different types of variables. and how to use them. Your computer can
handle single digit whole numbers or complex numbers of up to 38
places expressed in exponential notation with equal efficiency. You can
do your calculations directly or as part of programs Finally. this chapter
gives you a brief explanation of how to set up your own functions for
your computer to evaluate.
NUMBERS AND OPERATIONS
You can use your computer like a simple calculator. Besides the
standard + and — operation signs, your Commodore 16 uses the •
sign for multiplication and the / sign for division and fractions.
(Computers use the • sign nstead of an X for multiplication because a
computer can't tell the difference between me letter X and the
mathematical symbol X.) You can use these operators and numbers in
Immediate mode (no line numbers) or In program lines. Type In
numbers and operators in PRINT statements WITHOUT QUOTES if you
want your computer to perform the math involved If the numbers and
operators are in quotes (as in PRINT "2 + 2"). your computer will PRINT
exactly that on the screen. Instead of performing tne addition. You can
get Your computer to put !wo and two together by typing PRINT 2 +
2
BASIC MATHEMATICAL
OPERATORS
BASIC RELATIONAL OPERATORS
Addition
Subtraction
Division and fractions I
Multiplication
Exponentiation
(press SHIFT and 0)
NOTE: Your computer doesn't accept commas as part of a number.
For example, you have to type 30359 instead of 30.359.11 you put a
comma in a number, your computer thinks you mean two numbers
(separated by the comma). and would read it as 30 and 359 instead
of 30359.
Fractions and Decimals
You can write a fraction like this
5
or like this: 112 Your computer Is actually
performing the division
If you put a fraction in a PRINT statement, your answer is always
returned as a decimal or whole number. For example:
PRINT 139/493 + 5
ISMS
5.28194726
41" THE PI KEY
Here's an example that uses pi (3.14159265
). which represents
the ratio of the circumference of a circle to its diameter. Use this value
by just pressing the IT key (G and
PRINT Tr /374
RETURN
8.39998036E-03
Scientific Notation
What dra your computer mean by the E-03 part of the above answer?
Your computer displays decimal numbers in the range -999.999.999 to
999,999.999 in standard numerals. Numbers beyond this range (with
more than nine digits) are automatically displayed in scientific notation.
You can enter numbers in yourself in this form and your computer will
read tem with no trouble (certainly less trouble than you had
converting them!). Scientific notation is often useful, since this special
notation lets your computer display large numbers In fewer digits.
Here is how the number 198.505.478 would be written in scientific
notation
Only ONE digit is shown to the
lett of the decimal point
This number is the number of
digit places the decimal point is
moved
Greater than
Less than
Equals
Greater than or equal
Less than or equal
Not equal to
=>
or > —
< or gai <
< > Of > <
98505478E + 8
54
55

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Commodore 16 and is the answer not in the manual?

Questions and answers

Table of Contents