Download Print this page

Atari 400 Technical Reference Manual page 114

Home computer system
Hide thumbs Also See for 400:

Advertisement

IMPLEMENTATION DETAILS
Floating point numbers are maintained internally as 6-byte
~uantities,
with 5 bytes (10 BCD digits) of mantissa and 1 byte
of exponent. The mantissa is always normalized such that the
most significant byte is nonzero (note "byte" and not "BCD
digitU).
The most significant bit of the exponent byte provides the sign
for the mantissa; 0 for positive and 1 for negative. The
remaining 7 bits of the exponent byte provide the exponent in
excess 64 notation. The resulting number represents powers of 100
decimal (not powers of 10). This storage format allows the
mantissa to hold 10 BCD digits when the value of the exponent is
an even power of 10, and 9 BCD digits when the value of the
exponent is an odd power of 10.
The implied decimal point is always to the immediate right of the
first byte. An exponent less than 64 indicates a number less than
1. An exponent equal to or greater than 64 represents a number
e~ual
to or greater than 1.
Zero is represented by a zero manti ssa and a zero exp anent.
To
test for a result from any of the standard routines; test either
the exponent or the first mantissa byte for zero.
The absolute value of floating point numbers must be greater than
10**-98, and less than 10**+98, or be equal to zero. There is
perfect symmetry between positive and negative numbers with the
exception that negative zero is never generated.
The precision of all computations is maintained at 9 or 10
decimal digits, but accuracy is somewhat less for those functions
involving polynomial approximations (logarithm and
exponentiation>. Also, the problems inherent in all floating
point systems are present here; for example: subtracting two very
nearly
e~ual
numbers, adding numbers of disparate magnitude, or
successions of any operation, will all result in a loss of
significant digits. An analysis of the data range and the order
of evaluation of expressions may be required for some types of
applications.
The examples below compare floating point numbers with their
internal representationsl as an aid to understanding storage
format. All numbers prior to this point have been expressed in
decimal notation, but these examples will use hexadecimal
notation. Note that 64 decimal (the excess number of the
exponent) is 40 when expressed in hexadecimal:
Number: +0.02
=
2 * 10**-2
=
2 * 100**-1
Stored: 3F 02 00 00 00 00
(FP exponent
=
40
-
1 )
Number: -0.02
=
-2 * 10**-2 = -2
* .
100**-1
Stored: BF 02 00 00 00 00
(FP exponent = 80
+
40 - 1 )
OPERATING SYSTEM C016555 -- Section 8
129

Hide quick links:

Advertisement

loading

This manual is also suitable for:

800