Page images
PDF
EPUB
[blocks in formation]

10 PRINT "PROGRAM FILE 36: ERROR UNMATCHED PARENTHESES IN" 15 PRINT "

NUMERIC EXPRESSION."

[blocks in formation]

60 PRINT "THIS SECTION TESTS WHETHER THE PROCESSOR DETECTS AND REPORTS" 70 PRINT "A NUMERIC EXPRESSION WHICH IS IMPROPERLY FORMED BECAUSE THE" 80 PRINT "PARENTHESES ARE NOT MATCHED."

100 PRINT

110 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 120 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

130 PRINT

140 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION"
150 PRINT "
ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION"
BY THE PROCESSOR, OR"

160 PRINT "

170 PRINT

180 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 190 PRINT

200 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 210 PRINT "FOR DETAILED CRITERIA."

[blocks in formation]

245 PRINT "ABOUT TO COMPUTE: 8+(7−(9−88)/3+(7-9)−3"

250 LET A=8+(7-(9-88)/3+(7-9)-3

260 PRINT "VALUE ASSIGNED FROM ILLEGAL EXPRESSION = ";A

[blocks in formation]

10 PRINT "PROGRAM FILE 37: ERROR - USE OF '**' AS OPERATOR." 20 PRINT"

30 PRINT

ANSI STANDARD 7.2"

**

*****

40 PRINT "SECTION 37.1: ERROR USE OF 50 PRINT

' AS OPERATOR."

60 PRINT "THIS SECTION TESTS WHETHER THE PROCESSOR DETECTS AND REPORTS"
70 PRINT "A NUMERIC EXPRESSION WHICH IS IMPROPERLY FORMED BECAUSE A"
80 PRINT "DOUBLE ASTERISK (**) IS USED AS AN OPERATOR, PRESUMABLY"
90 PRINT "FOR INVOLUTION."

100 PRINT

110 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 120 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

130 PRINT

140 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION"
150 PRINT "
ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION"
BY THE PROCESSOR, OR"

160 PRINT "

170 PRINT

180 PRINT " 2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE" 190 PRINT

200 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 210 PRINT "FOR DETAILED CRITERIA."

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

60 PRINT "THIS SECTION TESTS WHETHER THE PROCESSOR DETECTS AND REPORTS" 70 PRINT "A NUMERIC EXPRESSION WHICH IS IMPROPERLY FORMED BECAUSE TWO" 80 PRINT "OPERATORS ARE USED IN SUCCESSION."

100 PRINT

110 PRINT "THIS IS A TEST FOR A NON-STANDARD FEATURE OF MINIMAL BASIC." 120 PRINT "TO PASS THIS TEST, THE PROCESSOR MUST EITHER:"

130 PRINT

140 PRINT " 1) ACCEPT THE PROGRAM AND BE ACCOMPANIED BY DOCUMENTATION"
150 PRINT "
ACCURATELY DESCRIBING THE FEATURE'S INTERPRETATION"
BY THE PROCESSOR, OR"

160 PRINT "

170 PRINT 180 PRINT " 190 PRINT

2) REJECT THE PROGRAM WITH AN APPROPRIATE ERROR MESSAGE"

黃黃黃

200 PRINT "SEE THE NBS MINIMAL BASIC TEST PROGRAMS USER'S MANUAL" 210 PRINT "FOR DETAILED CRITERIA."

[blocks in formation]

10 PRINT "PROGRAM FILE 39: ACCURACY OF ADDITION"

20 PRINT " ANSI STANDARD 7.2, 7.4, 7.6"

30 PRINT

40 PRINT "*** NOTE: THIS PROGRAM MAKES USE OF 'READ' AND 'DATA'" 50 PRINT "

60 PRINT " 70 PRINT " 80 PRINT

WHICH HAVE NOT YET BEEN TESTED. IF SUBSEQUENT TESTS SHOW"
THESE FEATURES TO BE INCORRECTLY IMPLEMENTED, THEN THE"
VALIDITY OF THE RESULTS OF THIS TEST ROUTINE IS DOUBTFUL."

100 PRINT "SECTION 39.1 ACCURACY OF ADDITION."

110 PRINT

120 PRINT "THIS SECTION TESTS THE ACCURACY OF ADDITION. THE COMPUTED" 130 PRINT "RESULT IS COMPARED WITH A RANGE ESTABLISHED BY PERTURBING" 140 PRINT "EACH OPERAND BY 1 IN ITS 6TH DIGIT. THE RESULT PASSES IF" 150 PRINT "IT FALLS WITHIN THE EXTREME VALUES GENERATED BY THIS" 160 PRINT "PERTURBATION (ACCURATE TO SIX DIGITS)."

220 PRINT

230 PRINT "THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD" 240 PRINT "DOES NOT MANDATE ANY ACCURACY FOR NUMERIC EXPRESSIONS." 250 PRINT

[blocks in formation]

280 PRINT "FIRST","SECOND","TRUE","COMPUTED","TEST"

290 PRINT "OPERAND","OPERAND","VALUE","VALUE","RESULT" 300 PRINT

310 LET F=0

320 READ A1, A2,T,L, H

330 IF A1=999 THEN 480

335 LET M$="PASS"

340 LET C=A1+A2

350 IF C<L THEN 380

360 IF C>H THEN 380

370 GOTO 400

380 LET M$="FAIL"

390 LET F=F+1

400 PRINT A1, A2,T,C,M$

410 GOTO 320

480 PRINT

490 IF F-0 THEN 520

500 PRINT "*** INFORMATIVE TEST FAILED IN ";F;" CASE(S) 510 GOTO 530

520 PRINT "*** INFORMATIVE TEST PASSED ***"

[blocks in formation]

3000 DATA

0.876543000E+03, 0.123453000E+03, 0.999996000E+03 3010 DATA 0.999993499E+03, 0.999998500E+03

3020 DATA

0.811111000E-01, 0.111111000E-01, 0.922222000E-01 3030 DATA 0.922219499E-01, 0.922224500E-01

3040 DATA -0.579999000E+02,-0.111111000E+00, -0.581110110E+02 3050 DATA -0.581111621E+02,-0.581108600E+02

3060 DATA 0.111111100E+07, 0.111111100E+07, 0.222222200E+07 3070 DATA 0.222219700E+07, 0.222224700E+07

3080 DATA 0.654321000E+01, 0.123456000E+01, 0.777777000E+01 3090 DATA 0.777774499E+01, 0.777779500E+01

3100 DATA 0.654321000E-09, 0.123456000E-09, 0.777777000E-09 3110 DATA 0.777774499E-09, 0.777779500E-09

3120 DATA -0.654321000E-19,-0.123456000E-19,-0.777777000E-19 3130 DATA -0.777779500E-19,-0.777774499E-19

3140 DATA 0.654321000E-29, 0.123456000E-29, 0.777777000E-29 3150 DATA 0.777774500E-29, 0.777779500E-29

3160 DATA 0.654321000E-37, 0.123456000E-37, 0.777777000E-37 3170 DATA 0.777774500E-37, 0.777779500E-37

3180 DATA 0.123456000E+11, 0.654321000E+11, 0.777777000E+11 3190 DATA 0.777774500E+11, 0.777779500E+11

3200 DATA -0.123456000E+21,-0.654321000E+21,-0.777777000E+21 3210 DATA -0.777779500E+21,-0.777774500E+21

3220 DATA 0.123456000E+31, 0.654321000E+31, 0.777777000E+31 3230 DATA 0.777774499E+31, 0.777779500E+31

3240 DATA 0.123456000E+38, 0.654321000E+38, 0.777777000E+38 3250 DATA 0.777774499E+38, 0.777779500E+38

3260 DATA 0.499997000E-01, 0.499996000E-01, 0.999993000E-01 3270 DATA 0.999990499E-01, 0.999995500E-01

3280 DATA 0.999993000E-01, 0.400000000E-06, 0.999997000E-01 3290 DATA 0.999995499E-01, 0.999998501E-01

3300 DATA

3310 DATA

3320 DATA

3330 DATA

3340 DATA

3350 DATA

0.999993000E-01, 0.400000000E-07, 0.999993400E-01 0.999991899E-01, 0.999994901E-01

0.999993000E-01, 0.400000000E-08, 0.999993040E-01 0.999991539E-01, 0.999994541E-01

0.999993000E-01, 0.400000000E-09, 0.999993004E-01 0.999991503E-01, 0.999994505E-01

3360 DATA 0.999993000E-01, 0.400000000E-10, 0.999993000E-01 3370 DATA 0.999991500E-01, 0.999994501E-01

3380 DATA -0.102030400E+07, 0.400000000E+01,-0.102030000E+07 3390 DATA -0.102031501E+07,-0.102028499E+07

3400 DATA

0.102030400E+07,-0.304000000E+03, 0.102000000E+07

3410 DATA 0.101998499E+07, 0.102001501E+07

3420 DATA -0.102030400E+07, 0.203040000E+05,-0.100000000E+07 3430 DATA -0.100001510E+07,-0.999989400E+06

3440 DATA -0.102030400E+07, 0.102030400E+07, 0.000000000E+00 3450 DATA -0.200000500E+02, 0.200000500E+02

3460 DATA -0.102030400E+00, 0.400000000E-06,-0.102030000E+00 3470 DATA -0.102031501E+00, -0.102028499E+00

3480 DATA

0.102030400E+00, -0.304000000E-04, 0.102000000E+00 3490 DATA 0.101998499E+00, 0.102001501E+00

3500 DATA -0.102030400E+00, 0.203040000E-02,-0.100000000E+00 3510 DATA -0.100001510E+00, -0.999989400E-01

3520 DATA -0.102030400E+00, 0.102030400E+00, 0.000000000E+00 3530 DATA -0.200000500E-05, 0.200000500E-05

3540 DATA -0.102030400E+00, 0.102030300E+00, -0.100000000E-06 3550 DATA -0.210000501E-05, 0.190000500E-05

3560 DATA -0.102030400E+00, 0.102030500E+00, 0.100000000E-06 3570 DATA -0.190000500E-05, 0.210000501E-05

5000 DATA 999,0,0,0,0

5010 END

PROGRAM FILE 39: ACCURACY OF ADDITION

ANSI STANDARD 7.2, 7.4, 7.6

*** NOTE: THIS PROGRAM MAKES USE OF 'READ' AND 'DATA'
WHICH HAVE NOT YET BEEN TESTED. IF SUBSEQUENT TESTS SHOW
THESE FEATURES TO BE INCORRECTLY IMPLEMENTED, THEN THE
VALIDITY OF THE RESULTS OF THIS TEST ROUTINE IS DOUBTFUL.

SECTION 39.1 ACCURACY OF ADDITION.

THIS SECTION TESTS THE ACCURACY OF ADDITION. THE COMPUTED
RESULT IS COMPARED WITH A RANGE ESTABLISHED BY PERTURBING
EACH OPERAND BY 1 IN ITS 6TH DIGIT. THE RESULT PASSES IF
IT FALLS WITHIN THE EXTREME VALUES GENERATED BY THIS
PERTURBATION (ACCURATE TO SIX DIGITS).

THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD
DOES NOT MANDATE ANY ACCURACY FOR NUMERIC EXPRESSIONS.

[merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][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][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small]
« PreviousContinue »