Page images
PDF
EPUB

1770 PRINT -1.23456,89123.4.-2.34567 1780 PRINT +295.65,.023,-67.8954 1790 PRINT 1800 PRINT "*** TEST PASSED IF THE FIRST THREE PRINT ZONES EACH CONTAIN" 1810 PRINT A COLUMN OF REAL NUMBERS USING EXPLICIT POINT," 1820 PRINT UNSCALED REPRESENTATION **** 1825 PRINT 1830 PRINT "

END TEST." 1840 PRINT 1850 PRINT "SECTION 9.8: SPACE ALLOTMENT FOR PRINTED NR2 NUMBERS." 1860 PRINT 1870 PRINT "PRINTED NR2 CONSTANTS ARE PRECEDED BY A SPACE IF POSITIVE" 1880 PRINT "OR BY A MINUS IF NEGATIVE, AND ARE FOLLOWED BY A SPACE." 1890 PRINT "THE FIELDS FOR THE CONSTANTS ARE DELIMITED BY ASTERISKS." 1900 PRINT 1910 PRINT

BEGIN TEST." 1920 PRINT 1930 PRINT "00000000011111111112222222222333333333344444444445"; 1940 PRINT "5555555556666666666777" 1950 PRINT "12345678901234567890123456789012345678901234567890"; 1960 PRINT "1234567890123456789012" 1970 PRINT "*":90000.1;"*", "*":.000123;"*","*";.000009;"*" 1980 PRINT "*";+900.001;"*","*";+0.000123;"*","*";+0.000009;"*"

;*" 1990 PRINT "*":-0.900001;"*","#":-0.000123;"*","*":-0.000009;"*" 2000 PRINT 2010 PRINT "*";.234567;"*" "*";1.23456;"*" "*:91.2345;"*"

,,; 2020 PRINT "*";+0.234567;"*","*";+1.23456;"*","*";91.2345;"*" 2030 PRINT "*":-0.234567;"*","*";-1.23456;"*","*";-91.2345;"*" 2040 PRINT 2050 PRINT "*";865.789;"*","*";1234.56;"*","*":99999.9;"*"

nin 2060 PRINT "*" ;+865.789;"*" "*";+1234.56;"*" "*";+99999.9;"*"

, 2070 PRINT "*";-865.789;"*","#";-1234.56;"*","*" ***

!";-1234.56;"*","*";-99999.9;"*" 2080 PRINT 2090 PRINT "*** TEST PASSED IF EACH NUMBER IS PRECEDED BY A SPACE OR" 2100 PRINT " A MINUS SIGN, AND FOLLOWED BY A SPACE AND THE NUMBERS" 2110 PRINT USE EXPLICIT POINT, UNSCALED REPRESENTATION **** 2120 PRINT 2130 PRINT "

END TEST." 2335 PRINT 2340 PRINT "END PROGRAM 9" 2350 END

.

[ocr errors]

PROGRAM FILE 9: PRINTING NR 1 AND NR 2 NUMERIC CONSTANTS.

ANSI STANDARD 5.2, 5.4, 12.4

SECTION 9.1: CONSTANTS IN NR1 FORM (INTEGERS).

COLUMNS 1 AND 3 SHOW THE OUTPUT AS IT SHOULD BE.
COLUMNS 2 AND 4 SHOW THE ACTUAL OUTPUT.

BEGIN TEST.

-1

000000000111111111122222222223333333333444444444455555555556666666666777 123456789012345678901234567890123456789012345678901234567890123456789012 SHOULD BE ACTUAL

SHOULD BE ACTUAL 0 0 0

0 1 1

-1 12 12 -12

-12 123 123 -123

-123 1234 1234 -1234

-1234 12345 12345 -12345

-12345 123456 123456 -123456

-123456 999999 999999 -999999

-999999

*** TEST PASSED IF COLUMNS 1 & 2, AND 3 & 4 CONTAIN THE SAME NUMERIC REPRESENTATION FOR EACH PAIR OF INTEGERS

***

END TEST.

SECTION 9.2: NR1 CONSTANTS SEPARATED BY COMMAS TO PRODUCE

TABULAR OUTPUT.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556666666666777 123456789012345678901234567890123456789012345678901234567890123456789012 1 -12

123 -1234

12345

-123456 123456 -1234

123

*** TEST PASSED IF THE FIRST THREE PRINT ZONES EACH CONTAIN

A COLUMN OF INTEGERS

END TEST.

SECTION 9.3: SPACE ALLOTTED FOR PRINTED INTEGER CONSTANTS.

PRINTED INTEGER CONSTANTS ARE PRECEDED BY A SPACE IF
POSITIVE, A MINUS IF NEGATIVE AND FOLLOWED BY A SPACE.
THE SPACE FOR THE CONSTANT IS DELIMITED BY ASTERISKS.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556666666666777 123456789012345678901234567890123456789012345678901234567890123456789012 SHOULD BE: * 1

* 456 * ACTUAL: * 1 *

*-23 *

* 456 *

*-23 *

SHOULD BE:

ACTUAL:

# 7890 *
* 7890 *

*-12345 *
*-12345 *

* 678901 *
* 678901 *

*** TEST PASSED IF 'ACTUAL' LINES MATCH CORRESPONDING

'SHOULD BE' LINES ***

END TEST.

SECTION 9.4: NR1 CONSTANTS SEPARATED BY SEMICOLONS.

PRINTED INTEGER CONSTANTS ARE PRECEDED BY A SPACE IF
POSITIVE OR A MINUS IF NEGATIVE AND ARE FOLLOWED BY A SPACE.
THE SEMICOLON SEPARATOR PRODUCES A NULL STRING.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556666666666777 123456789012345678901234567890123456789012345678901234567890123456789012 SHOULD BE: 0 0 1 -12 123 -1234 12345 -123456

ACTUAL: 0 0 1 -12 123 -1234 12345 -123456

*** TEST PASSED IF 'ACTUAL' LINE MATCHES CORRESPONDING

'SHOULD BE' LINE ***

END TEST.

SECTION 9.5: CONSTANTS IN NR2 FORM.

COLUMNS 1 AND 3 SHOW THE OUTPUT AS IT SHOULD BE.
COLUMNS 2 AND 4 SHOW THE ACTUAL OUTPUT.

EXPECTED OUTPUT IS DISPLAYED WITH TRAILING ZEROS
SUPPRESSED. IMPLEMENTATIONS MAY ADD TRAILING ZEROS UP TO
THEIR SIGNIFICAND-WIDTH, D. THUS . 12 MAY BE DISPLAYED AS
'.1200' OR '.1200000' IF, FOR INSTANCE, D : 7.

.

BEGIN TEST.

.1

.

[ocr errors]
[ocr errors]

000000000111111111122222222223333333333444444444455555555556666666666777 123456789012345678901234567890123456789012345678901234567890123456789012 SHOULD BE ACTUAL

SHOULD BE ACTUAL
.1
-.1

-.1
. 12
. 12
-.12

-.12 . 123

. 123
-. 123

-. 123 . 1234

.1234
-.1234

-. 1234 . 12345

. 12345 -.12345 -. 12345 .123456

. 123456 -. 123456 -. 123456 .234567

.234567 -.234567 -.234567 .345678

.345678 -.345678 -.345678 456789

456789 -.456789 -.456789 .56789

.56789
-.56789

-.56789 .6789

.6789
-.6789

-.6789 .789

.789
-.789

-.789 .89

.89
-.89

-.89
.9
.9

-.9 0 0 0

0 1.23456

1.23456 -1.23456 -1.23456 9.876 9.876 -9.876

-9.876 12.3456

12.3456 -12.3456 -12.3456 123.456

123.456 -123.456 -123.456 1234.56

1234.56 -1234.56 -1234.56 12345.6

12345.6 -12345.6 -12345.6 23456.7

23456.7 -23456.7 -23456.7

-.9

34567.8 45678.9 56789.1 67891.2 78912.3 89123.4 91234.5 99999.9

34567.8
45678.9
56789.1
67891.2
78912.3
89123.4
91234.5
99999.9

-34567.8
-45678.9
-56789.1
-67891.2
-78912.3
-89123.4
-91234.5
-99999.9

-34567.8
-45678.9
-56789.1
-67891.2
-78912.3
-89123.4
-91234.5
-99999.9

[ocr errors]

*** TEST PASSED IF COLUMNS 1 & 2, AND 3 & 4 CONTAIN THE

SAME REPRESENTATION FOR EACH PAIR OF NUMBERS (ALLOWING FOR OPTIONAL TRAILING ZEROS)

***

END TEST.

SECTION 9.6: USING NR2 INSTEAD OF NR3 FORMAT FOR

SIX-DIGIT CONSTANTS.

NUMBERS THAT CAN BE REPRESENTED IN THE UNSCALED
REPRESENTATION NO LESS ACCURATELY THAN AS IN
SCALED FORMAT, SHALL BE OUTPUT USING THE UNSCALED FORMAT.

[ocr errors]
[blocks in formation]

*** TEST PASSED IF COLUMNS 1 & 2, AND 3 & 4 CONTAIN THE

SAME REPRESENTATION FOR EACH PAIR OF NUMBERS (ALLOWING FOR OPTIONAL TRAILING ZEROS) ***

END TEST.

SECTION 9.7: NR2 CONSTANTS SEPARATED BY COMMAS TO PRODUCE

TABULAR OUTPUT.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556666666666777 123456789012345678901234567890123456789012345678901234567890123456789012 . 123456 -99999.9

91234.5 -1.23456

89123.4 -2.34567 295.65

.023

-67.8954

*** TEST PASSED IF THE FIRST THREE PRINT ZONES EACH CONTAIN

A COLUMN OF REAL NUMBERS USING EXPLICIT POINT,
UNSCALED REPRESENTATION ***

END TEST.

SECTION 9.8: SPACE ALLOTMENT FOR PRINTED NR2 NUMBERS.

PRINTED NR2 CONSTANTS ARE PRECEDED BY A SPACE IF POSITIVE
OR BY A MINUS IF NEGATIVE, AND ARE FOLLOWED BY A SPACE.
THE FIELDS FOR THE CONSTANTS ARE DELIMITED BY ASTERISKS.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556666666666777
123456789012345678901234567890123456789012345678901234567890123456789012
* 90000.1 * * .000123 * .000009 +
# 900.001 # * .000123 * .000009 *
*-.900001 * #-.000123 *-.000009 *

[ocr errors]
[merged small][merged small][merged small][merged small][ocr errors][merged small][merged small][merged small]

*** TEST PASSED IF EACH NUMBER IS PRECEDED BY A SPACE OR

A MINUS SIGN, AND FOLLOWED BY A SPACE AND THE NUMBERS
USE EXPLICIT POINT, UNSCALED REPRESENTATION ***

[blocks in formation]

10 PRINT "PROGRAM FILE 10: PRINTING NR3 NUMERIC CONSTANTS."
20 PRINT ANSI STANDARD 5.2, 5.4, 12.4"
30 PRINT
60 PRINT "THESE TESTS ASSUME THAT A MINIMUM OF SIX SIGNIFICANT DIGITS"
70 PRINT "WILL BE PRINTED. PROCESSORS WHICH PRINT MORE SIGNIFICANT"
80 PRINT "DIGITS SHOULD HAVE COMPARABLE ACCURACY."
90 PRINT
91 PRINT "NOTE THAT THE DISPLAYED STANDARD OUTPUT IS ORIENTED TO"
92 PRINT "THE MINIMAL REQUIREMENTS OF SIGNIFICAND-WIDTH, D, "
93 PRINT "EQUAL TO SIX, AND EXRAD-WIDTH, E, EQUAL TO TWO. FOR D > 6"
94 PRINT "AND E > 2, THERE MAY BE EXTRA TRAILING AND LEADING ZEROS,"
95 PRINT "RESPECTIVELY."
96 PRINT
97 PRINT "SECTION 10.1: POSITIVE NUMBER AND SIGNED SIGNIFICAND."
98 PRINT
100 PRINT"

BEGIN TEST."
110 PRINT
140 PRINT "SOURCE FORM: SIGNED SIGNIFICAND BOTH COLUMNS"
150 PRINT

UNSIGNED EXRAD - COLUMN 1" 160 PRINT "

SIGNED EXRAD

COLUMN 21 190 PRINT

[ocr errors]
[ocr errors]
« PreviousContinue »