Page images
PDF
EPUB

1770 PRINT -1.23456,89123.4,-2.34567 1780 PRINT +295.65,.023,-67.8954

1790 PRINT

1810 PRINT "

1800 PRINT "*** TEST PASSED IF THE FIRST THREE PRINT ZONES EACH CONTAIN" A COLUMN OF REAL NUMBERS USING EXPLICIT POINT," UNSCALED REPRESENTATION ***"

1820 PRINT "

1825 PRINT

1830 PRINT "

1840 PRINT

END TEST."

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 "

1920 PRINT

BEGIN TEST."

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;"*n
2030 PRINT "*";-0.234567; "*","*":-1.23456;"*","*";-91.2345; "*"
2040 PRINT

2050 PRINT "*";865.789;"*","*";1234.56;"*","*":99999.9;"*n
2060 PRINT "*";+865.789;"*","*";+1234.56;"*","*"; +99999.9; "*n
2070 PRINT "*":-865.789;"*","*";-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" USE EXPLICIT POINT, UNSCALED REPRESENTATION ***"

2110 PRINT "

[blocks in formation]

PROGRAM FILE 9: PRINTING NR1 AND NR2 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.

[blocks in formation]

*** 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.

[blocks in formation]

*** 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.

[blocks in formation]

*** 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.

[blocks in formation]

*** 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.

[blocks in formation]
[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.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.

[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.

[blocks in formation]

*** 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 *

[blocks in formation]

* .000009 *
*-.000009 *

91.2345 * * 91.2345 * *-91.2345 *

* 99999.9 *
* 99999.9 *
*-99999.9 *

*** 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 ***

END PROGRAM 9

****

黃黃

END TEST.

10 PRINT "PROGRAM FILE 10: PRINTING NR3 NUMERIC CONSTANTS." 20 PRINT "

30 PRINT

ANSI STANDARD 5.2, 5.4, 12.4"

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

[merged small][merged small][merged small][merged small][ocr errors][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small]
« PreviousContinue »