Page images
PDF
EPUB
[blocks in formation]

790 PRINT "*** TEST FAILED: VALUE SUPPLIED GREATER THAN MINIMUM" 800 PRINT " NEGATIVE MACHINE INFINITY. ***11

810 GOTO 850

820 PRINT "LAST TWO MULTIPLICATIONS SHOULD HAVE BEEN REPORTED" 830 PRINT "AS OVERFLOW, AND NEGATIVE INFINITY SUPPLIED; IF SO," 840 PRINT "*** TEST PASSES *** OTHERWISE *** TEST FAILS *** " 850 PRINT

[blocks in formation]
[ocr errors]

PROGRAM FILE 29: EXCEPTION OVERFLOW OF NUMERIC EXPRESSIONS. ANSI STANDARD 7.5

THIS PROGRAM TESTS VARIOUS CASES OF NUMERIC OVERFLOW.

SECTION 29.1: POSITIVE OVERFLOW

THIS SECTION TESTS THE RESULT OF EXPRESSION EVALUATION
EXCEEDING POSITIVE MACHINE INFINITY.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE
DISPLAYED, AND

2) POSITIVE INFINITY MUST BE SUPPLIED AS THE VALUE
OF THE EXPRESSION AND EXECUTION CONTINUES.

BEGIN TEST

[blocks in formation]

LAST TWO MULTIPLICATIONS SHOULD HAVE BEEN REPORTED AS OVERFLOW, AND POSITIVE INFINITY SUPPLIED; IF SO, *** TEST PASSED *** OTHERWISE *** TEST FAILED ***

END TEST

SECTION 29.2: NEGATIVE OVERFLOW

THIS SECTION TESTS THE RESULT OF EXPRESSION EVALUATION EXCEEDING NEGATIVE MACHINE INFINITY.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE
DISPLAYED, AND

2) NEGATIVE INFINITY MUST BE SUPPLIED AS THE VALUE OF THE EXPRESSION AND EXECUTION CONTINUES.

[blocks in formation]
[blocks in formation]

LAST TWO MULTIPLICATIONS SHOULD HAVE BEEN REPORTED

AS OVERFLOW, AND NEGATIVE INFINITY SUPPLIED; IF SO, *** TEST PASSES *** OTHERWISE *** TEST FAILS ***

END PROGRAM 29

END TEST

10 PRINT "PROGRAM FILE 30: EXCEPTION - OVERFLOW OF NUMERIC CONSTANTS." 20 PRINT " ANSI STANDARD 5.4, 5.5"

30 PRINT

40 PRINT "THIS PROGRAM TESTS VARIOUS CASES OF CONSTANT OVERFLOW." 50 PRINT

60 PRINT "SECTION 30.1: POSITIVE CONSTANT OVERFLOW"

70 PRINT

80 PRINT "THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION"

90 PRINT "EXCEEDING POSITIVE MACHINE INFINITY."

100 PRINT

110 PRINT "TO PASS THIS TEST:"

120 PRINT

130 PRINT " 140 PRINT " 150 PRINT 160 PRINT " 170 PRINT "

180 PRINT

190 PRINT "

200 PRINT

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE"
DISPLAYED, AND"

2) POSITIVE INFINITY MUST BE SUPPLIED AS THE VALUE" OF THE CONSTANT AND EXECUTION CONTINUES."

360 LET A=3E99999

BEGIN TEST"

365 PRINT "RESULT OF ASSIGNING 3E99999 = ";A

370 IF A>.99E38 THEN 410

380 PRINT "*** TEST FAILED: VALUE SUPPLIED LESS THAN MINIMUM" 390 PRINT"

400 GOTO 440

POSITIVE MACHINE INFINITY. ***"

410 REM RESULT > MINIMUM

420 PRINT "IF (RESULT = 3E99999) OR "

425 PRINT " (RESULT = POSITIVE INFINITY AND EXCEPTION REPORTED)" 430 PRINT '*** TEST PASSED *** OTHERWISE *** TEST FAILED ***" 440 PRINT

[blocks in formation]

470 PRINT "SECTION 30.2: NEGATIVE CONSTANT OVERFLOW"

480 PRINT

490 PRINT "THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION"

500 PRINT "EXCEEDING NEGATIVE MACHINE INFINITY."

510 PRINT

520 PRINT "TO PASS THIS TEST:"

530 PRINT

540 PRINT " 550 PRINT " 560 PRINT

570 PRINT "

580 PRINT "

590 PRINT

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE"
DISPLAYED, AND"

2) NEGATIVE INFINITY MUST BE SUPPLIED AS THE VALUE" OF THE CONSTANT AND EXECUTION CONTINUES."

[blocks in formation]

790 PRINT "*** TEST FAILED: VALUE SUPPLIED GREATER THAN MINIMUM" 800 PRINT "

810 GOTO 850

NEGATIVE MACHINE INFINITY.

820 REM RESULT < MAXIMUM

830 PRINT "IF (RESULT = -3E99999) OR "

835 PRINT " (RESULT = NEGATIVE INFINITY AND EXCEPTION REPORTED)" 840 PRINT "*** TEST PASSES *** OTHERWISE *** TEST FAILS *** "

850 PRINT

860 PRINT "

870 PRINT

880 PRINT "END PROGRAM 30"

890 END

END TEST"

PROGRAM FILE 30: EXCEPTION

ANSI STANDARD 5.4, 5.5

OVERFLOW OF NUMERIC CONSTANTS.

THIS PROGRAM TESTS VARIOUS CASES OF CONSTANT OVERFLOW.

SECTION 30.1: POSITIVE CONSTANT OVERFLOW

THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION
EXCEEDING POSITIVE MACHINE INFINITY.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE

DISPLAYED, AND

2) POSITIVE INFINITY MUST BE SUPPLIED AS THE VALUE OF THE CONSTANT AND EXECUTION CONTINUES.

[blocks in formation]

(RESULT = POSITIVE INFINITY AND EXCEPTION REPORTED) *** TEST PASSED *** OTHERWISE *** TEST FAILED ***

END TEST

SECTION 30.2: NEGATIVE CONSTANT OVERFLOW

THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION
EXCEEDING NEGATIVE MACHINE INFINITY.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE DISPLAYED, AND

2) NEGATIVE INFINITY MUST BE SUPPLIED AS THE VALUE OF THE CONSTANT AND EXECUTION CONTINUES.

BEGIN TEST

% OVERFLOW IN LINE 770

RESULT OF ASSIGNING -3E99999 = -1.70141E+38

IF (RESULT = -3E99999) OR

(RESULT = NEGATIVE INFINITY AND EXCEPTION REPORTED) *** TEST PASSES *** OTHERWISE *** TEST FAILS ***

END PROGRAM 30

END TEST

10 PRINT "PROGRAM FILE 31: EXCEPTION ZERO RAISED TO A NEGATIVE POWER." 20 PRINT " ANSI STANDARD 7.5"

50 PRINT

60 PRINT "SECTION 31.1: EXCEPTION 100 PRINT

110 PRINT "TO PASS THIS TEST:"

120 PRINT

130 PRINT "

140 PRINT " 150 PRINT

160 PRINT " 170 PRINT " 180 PRINT

[blocks in formation]

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE"
DISPLAYED, AND"

2) POSITIVE INFINITY MUST BE SUPPLIED AS THE VALUE"
OF THE EXPRESSION AND EXECUTION CONTINUES."

« PreviousContinue »