Page images
PDF
EPUB
[blocks in formation]

10 PRINT "PROGRAM FILE 34: EXCEPTION - UNDERFLOW OF"

[blocks in formation]

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

60 PRINT "SECTION 34.1: POSITIVE CONSTANT UNDERFLOW"

70 PRINT

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

90 PRINT "LESS THAN POSITIVE MACHINE INFINITESIMAL."

100 PRINT

110 PRINT "TO PASS THIS TEST:"

120 PRINT

130 PRINT "

140 PRINT " 150 PRINT 160 PRINT " 170 PRINT " 180 PRINT

1) A MESSAGE IDENTIFYING AN EXCEPTION MAY BE"
DISPLAYED (NOT MANDATORY), AND"

2) ZERO MUST BE SUPPLIED AS THE VALUE"

OF THE CONSTANT AND EXECUTION CONTINUES."

[blocks in formation]

470 PRINT "SECTION 34.2: NEGATIVE CONSTANT UNDERFLOW" 480 PRINT

490 PRINT "THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION" 500 PRINT "GREATER THAN NEGATIVE MACHINE INFINITESIMAL."

510 PRINT

520 PRINT "TO PASS THIS TEST:"

530 PRINT

540 PRINT "

550 PRINT " 560 PRINT

570 PRINT "

580 PRINT "

1) A MESSAGE IDENTIFYING THE EXCEPTION MAY BE"

DISPLAYED (NOT MANDATORY), AND"

2) ZERO MUST BE SUPPLIED AS THE VALUE"

OF THE CONSTANT AND EXECUTION CONTINUES."

[blocks in formation]

775 PRINT "RESULT OF ASSIGNING -3E-99999 = ";A

[blocks in formation]

THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION
LESS THAN POSITIVE MACHINE INFINITESIMAL.

TO PASS THIS TEST:

[blocks in formation]

THIS SECTION TESTS THE RESULT OF CONSTANT EVALUATION
GREATER THAN NEGATIVE MACHINE INFINITESIMAL.

[blocks in formation]

10 PRINT "PROGRAM FILE 35: EXCEPTION OVERFLOW AND UNDERFLOW WITHIN" 20 PRINT "

30 PRINT "

40 PRINT

SUB-EXPRESSIONS"

ANSI STANDARD 7.4, 7.5"

50 PRINT "THIS PROGRAM TESTS THE EFFECT OF NUMERIC OVERFLOW AND"

60 PRINT "UNDERFLOW WITHIN A SUB-EXPRESSION ON THE CONTAINING"

70 PRINT "EXPRESSION."

80 PRINT

90 PRINT "SECTION 35.1: SUB-EXPRESSION OVERFLOW"

100 PRINT

110 PRINT "THIS SECTION TESTS THE EFFECT ON AN EXPRESSION OF NUMERIC" 120 PRINT "OVERFLOW WITHIN ONE OF ITS SUB-EXPRESSIONS."

130 PRINT

140 PRINT "TO PASS THIS TEST:"

150 PRINT

160 PRINT "

170 PRINT " 180 PRINT 190 PRINT "

200 PRINT "

210 PRINT

220 PRINT "

230 PRINT

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

2) MACHINE INFINITY MUST BE SUPPLIED AS THE VALUE" OF THE SUB-EXPRESSION."

BEGIN TEST"

240 PRINT "ABOUT TO COMPUTE -.01 * (10^ 99999) "

250 LET A=-.01 (10 99999)

260 PRINT "RESULT = ";A

[blocks in formation]

310 PRINT "IF RESULT = (-.01 MACHINE INFINITY)"

320 PRINT " AND OVERFLOW EXCEPTION REPORTED, THEN"

330 PRINT "*** TEST PASSES *** OTHERWISE *** TEST FAILS ***"

[blocks in formation]

370 PRINT "SECTION 35.2: SUB-EXPRESSION UNDERFLOW"

380 PRINT

390 PRINT "THIS SECTION TESTS THE EFFECT ON AN EXPRESSION OF NUMERIC"

400 PRINT "UNDERFLOW WITHIN ONE OF ITS OPERATIONS."

410 PRINT

420 PRINT "TO PASS THIS TEST:"

430 PRINT

440 PRINT " 450 PRINT " 460 PRINT

470 PRINT "

480 PRINT "

1) A MESSAGE IDENTIFYING THE EXCEPTION MAY BE"
DISPLAYED (NOT MANDATORY), AND"

2) ZERO MUST BE SUPPLIED AS THE VALUE"
OF THE SUB-EXPRESSION."

[blocks in formation]

A

520 PRINT "ABOUT TO COMPUTE 3+ (10 (-99999))"

530 LET A=3+ (10(-99999))

540 PRINT "RESULT = ";A

[blocks in formation]

PROGRAM FILE 35: EXCEPTION OVERFLOW AND UNDERFLOW WITHIN SUB-EXPRESSIONS

ANSI STANDARD 7.4, 7.5

THIS PROGRAM TESTS THE EFFECT OF NUMERIC OVERFLOW AND
UNDERFLOW WITHIN A SUB-EXPRESSION ON THE CONTAINING
EXPRESSION.

SECTION 35.1: SUB-EXPRESSION OVERFLOW

THIS SECTION TESTS THE EFFECT ON AN EXPRESSION OF NUMERIC OVERFLOW WITHIN ONE OF ITS SUB-EXPRESSIONS.

TO PASS THIS TEST:

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

2) MACHINE INFINITY MUST BE SUPPLIED AS THE VALUE
OF THE SUB-EXPRESSION.

BEGIN TEST

ABOUT TO COMPUTE -.01* (10 99999)

% OVERFLOW IN LINE 250

RESULT = -1.70141E+36

IF RESULT = (-.01 MACHINE INFINITY)

AND OVERFLOW EXCEPTION REPORTED, THEN

*** TEST PASSES *** OTHERWISE *** TEST FAILS ***

END TEST

SECTION 35.2: SUB-EXPRESSION UNDERFLOW

THIS SECTION TESTS THE EFFECT ON AN EXPRESSION OF NUMERIC UNDERFLOW WITHIN ONE OF ITS OPERATIONS.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MAY BE
DISPLAYED (NOT MANDATORY), AND

2) ZERO MUST BE SUPPLIED AS THE VALUE

OF THE SUB-EXPRESSION.

BEGIN TEST

ABOUT TO COMPUTE 3+ (10(-99999))

% UNDERFLOW IN LINE 530

RESULT = 3

« PreviousContinue »