If we use a ";" instead of a comma, the next value will be printed immediately following the
previous value.
NOTE
Numbers are always printed with at least one
trailing space. Any text to be printed must
always be enclosed in double quotes.
Try the following examples:
1. PRINT "ONE HALF EQUALS"; 1/2
ONE HALF EQUALS .5
2. PRINT 1,2,3
1 2
3
...
3. PRINT 1;2;3
1 2 3
4. PRINT -1;2;-3
-1 2 -3
205 NUMBER FORMAT
We will digress for a moment to explain the format of numbers in BASIC. Numbers are stored
internally to over nine digits of accuracy. When a number is printed, only nine digits are shown.
Every number may also have an exponent (a power of ten scaling factor).
The largest number that may be presented in AIM 65 BASIC is 1.70141183*10^38, while the
smallest positive number is 2.93873588*10^-39.
When a number is printed, the following rules define the format:
1. If the number is negative, a minus sign (-) is printed. If the number is positive, a space is
printed.
2. If the absolute value of the number is an integer in the range 0 to 999999999, it is
printed as an integer.
3. If the absolute value of the number is greater than or equal to 0.01 and less than or equal
to 999999999, it is printed in fixed point notation, with no exponent.
4. If the number does not fall under categories 2 or 3, scientific notation is used.
Scientific notation is formatted as follows: SX.XXXXXXXXESTT. (Each X is some integer,
0 to 9.)
The leading "S" is the sign of the number: a space for a positive number and a "-" for
for a negative one. One non-zero digit is printed before the decimal point. This it
followed by the decimal point and then the other eight digits of the mantissa. An
"E" is then printed (for exponent), followed by the sign (S) of the exponent; then
the two digits (TT) of the exponent itself. Leading zeroes are never printed; i.e.,
the digit before the decimal is never zero. Trailing zeroes are never printed. If there
is only one digit to print after all trailing zeroes are suppressed, no decimal point is
printed. The exponent sign will be "+" for positive and "-" for negative. Two
digits of the exponent are always printed; that is, zeroes are not suppressed in the
exponent field. The value of any number expressed thus is the number so the left
of the "E" times 10 raised to the power of the number to the right of the "E".
Regardless of what format is used, a space is always printed following a number. BASIC checks
to see if the entire number will fit on the current line. If it cannot, a carriage return/line feed is
executed before printing the number.
Following are examples of various numbers and the output format in which BASIC will output them:
NUMBER OUTPUT FORMAT
------------- -------------