Commodore PET User Manual page 67

Table of Contents

Advertisement

Numbers with decimal point:
0.5
0.0165432
-0.0000009
1.6
24.0055
-64.2
3.1416
Note that if vou put commas in a number and ask the PET ta print it. vou will
get a Syntax Error message. For example. vou must use
65000.
not
65.000.
Roundoff
Numbers always have at least eight digits of precision; they ean have
up to nine, depending on the number. The PET rounds off any additional sig-
nifieant digits. It rounds up when the next digit is five or more; it rounds down
when the next digit ;s four or less.
Roundoff will sometimes cause fractional numbers ta look inaccurate. Here
are sa me examples:
"?
5555555556
.555555555
t~---Appears
ta
round down on 6 or less. up on 7 or more.
~
~~~~~~~~~LJ'
;' • ,_1._1 _'._I._I._I._I::.J ,_, ..
. 555555556
?1111111115
.111111111
t
Appears
ta
round down on 5 or less. up on 6 or more.
?
11111111
~.6
1
.11111111~
These quirks result from the manner in which computers store floating point
numbers.
Seientific Notation
Floating point numbers can also be represented in scientific notation. When
numbers with ten or more digits are entered, the PET automatieally eonverts
them to seientifie notation. Scientific notation allows the PET ta accurately dis-
play these large numbers in a smaller number of spaces. For example:
F:EAD'T'.
?1111111114
1 • 11111111 E+(19
54

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents