EasyManuals Logo

Sinclair ZX81 User Manual

Sinclair ZX81
92 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #10 background imageLoading...
Page #10 background image
PRINT
3*(2+2)
gives the answer 3*4 = 12.
A combination like this is called an expression - in this case, an arithmetic or numeric expression
because the answer is a number. In general, whenever the computer is expecting a number from you, you
can give it an expression instead and it will work out the answer.
You can write numbers with decimal points (use the full stop), & you can also use scientific notation - as
is quite common on pocket calculators. In this, after an ordinary number (with or without a decimal point),
you can write an exponent part consisting of the letter E, then maybe + or -, & then a number without a
decimal point. The E here means '*10
**
' ('times ten to the power of'), so that
(Try printing these out on the ZX81.)
The easiest way of thinking of this is to imagine the exponent part shifting the decimal point along to the
right (for a positive exponent) or to the left (for a negative exponent).
You can also print more than one thing at once, separating them either with commas (,) or semicolons (;
or shifted X). If you use a comma, then the next number will be displayed starting either at the left hand
margin, or in the middle of the line in the 16th column. If you use a semicolon, then the next number will be
displayed immediately following the last one.
Try
PRINT
1;2;3;4;5;6;7;8;9;10
&
PRINT
1,2,3,4,5,6,7,8,9,10
to see the differences. You can mix commas & semicolons within a single
PRINT
statement if you want.
Summary
Statements:
PRINT
, with commas & semicolons
Operations: +,-,*,/,
**
Expressions, scientific notation
Exercises
1. Try
PRINT
2.34E0
PRINT
2.34E1
PRINT
2.34E2
and so on up to
PRINT
2.34E15
You will see that after a while the ZX81 also starts using scientific notation. This is because it never
takes more than 14 spaces to write a number in. Similarly, try
PRINT
2.34E-1
PRINT
2.34E-2
& so on.
2. Try
PRINT
1,,2,,3,,,4,,,,5
2.34E0 = 2.34 * 10**0 = 2.34
2.34E3 = 2.34 * 10**3 = 2340
2.34E-2 = 2.34 * 10**-2 = 0.0234 & so on.

Other manuals for Sinclair ZX81

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX81 and is the answer not in the manual?

Sinclair ZX81 Specifications

General IconGeneral
ProcessorZilog Z80A
Processor Speed3.25 MHz
ROM8 KB
InputMembrane keyboard
StorageCassette tape
Power Supply9V DC
Dimensions167 mm x 40 mm x 175 mm
Release Year1981
ManufacturerSinclair Research
Weight350 g
Operating SystemSinclair BASIC
RAM1 KB
PortsTV out, expansion port
DisplayTelevision (RF modulator output)

Related product manuals