English
Language : 

NSB8 Datasheet, PDF (83/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
PRECISION
Numbers in the standard version of NSB8 are stored with 8 digits precision. Other precisions are
available, see section NON STANDARD VERSION OF BASIC for details. NSB8 uses the most
accurate form of microcomputer arithmetic available: binary coded decimal (BCD), see section
COMPATIBILITY WITH OTHER BASICS. All arithmetic operations are rounded to 8 digits in the
standard version of NSB8, e.g., the sum of .12345678 and .011111111 would be rounded to
.13456789, since .134567891 requires 9 digits.
FRACTIONS
What is the decimal representation of 2/3? An endless string of 6’s after the decimal point is the only
correct answer. However, when doing decimal arithmetic, both people and computers round off the
long fraction to a reasonably accurate (but not completely accurate) number. BASIC, for example,
will round 2/3 to .66666667. notice that the local number of digits is now 8. It is impossible to get
a more accurate representation of 2/3 in non standard NSB8. The fraction 1/2, on the other hand,
needs only a single digit (.5) to represent it exactly!
MIXED DECIMAL FRACTIONS WITH LARGE WHOLE PARTS
Eight digit precision also means that the number 1234.56789 must be rounded before it can be
handled by the machine. NSB8 will round this to 1234.5679. Notice that the least important,
rightmost digit is rounded. This is BASIC’s standard rounding procedure, and insures that the
rounded number remains as close to the original value as possible.
Business users should note that the largest dollars and cents figure which may be exactly represented
by 8 digits (without rounding cents to dimes or dollars) is $999,999.99. For applications where
dollars and cents amounts larger than this must be handled, you should obtain a special version of
BASIC (with greater precision).
VERY LARGE NUMBER
The number 987654321 will be rounded to 987654320, and, henceforth will normally be printed in
scientific notation by BASIC as 9.8765432E+08. As you can see, the eight digit rule is followed in
this conversion, even though scientific notation is invoked in order to correctly represent the
number. The last (9th) digit is dropped, but scientific notation representation insures that a 0 will be
remembered for the ninth digit in order to maintain proper place values for the remaining
digits. Notice that, because of this effect, BASIC considers 987654320, 987654321, and 987654322
to be equal to one another because they differ only in their (ignored) ninth digits.
VERY SMALL NUMBER
The number .00000000123 will not be rounded by NSB8, but .00000000123456789 will be
rounded. To see why, think of the two numbers as expressed in scientific notation. The first becomes
1.23E-09. The mantissa (which is the only component of an E format number that is affected by
precision) is only 3 digits long, well within the 8 allowed. The second number converts to
NSB8
Rel. 5.10
Page 71