|
- REM ------------------------------------------------------------
- REM PURPOSE: TEST THE PARAMETER RANGE CHECKS
- REM AUTHOR: HOWARD WULF, AF5NE
- REM GENERATED: 02/21/2015 14:08:21
- REM FILENAME: F_EPS_X_N.BAS
- REM SYNTAX: N = EPS( X )
- REM UNIQUEID: F_EPS_X_N
- REM FUNCTION: EPS
- REM
- REM VARIABLE DESCRIPTION
- REM I CURRENT TESTCASE NUMBER
- REM E EXPECTED ERROR FLAG
- REM F ACTUAL ERROR FLAG
- REM R EXPECTED FUNCTION RESULT
- REM N ACTUAL FUNCTION RESULT
- REM X ACTUAL FUNCTION PARAMETER
- REM
- RESTORE 2000
- REM GET TESTCASE #
- READ I
- WHILE I > 0
- REM GET TESTCASE DATA
- READ E, R, X
- REM DISPLAY TESTCASE DATA
- PRINT "TESTCASE #";I,"E=";E,"R=";R, "X=";X
- REM EXECUTE TESTCASE
- N = 0
- S$ = ""
- ON ERROR GOTO 9000
- F = 0
- 999 N = EPS( X )
- ERROR 0
- REM DISPLAY TESTCASE RESULTS
- PRINT ,"F=";F,"N=";N
- REM VERIFY EXPECTED ERROR
- IF E <> F THEN
- PRINT "*** TEST FAILED, EXCEPTION MISMATCH ***"
- STOP
- END IF
- REM VERIFY EXPECTED RESULT
- IF R > 0 THEN
- LET RMIN = 0.99 * R
- IF R > MAXNUM / 1.012 THEN
- LET RMAX = MAXNUM
- ELSE
- LET RMAX = 1.01 * R
- END IF
- END IF
- IF R < 0 THEN
- IF R < - MAXNUM / 1.012 THEN
- LET RMIN = -MAXNUM
- ELSE
- LET RMIN = 1.01 * R
- END IF
- LET RMAX = 0.99 * R
- END IF
- IF R = 0 THEN
- LET RMIN = -.01
- LET RMAX = +.01
- END IF
- IF N < RMIN THEN
- PRINT "*** TEST FAILED, RESULT MISMATCH ***"
- STOP
- END IF
- IF N > RMAX THEN
- PRINT "*** TEST FAILED, RESULT MISMATCH ***"
- STOP
- END IF
- PRINT "*** TEST PASSED ***"
- REM GET NEXT TESTCASE #
- READ I
- WEND
- PRINT "*** ALL TESTS PASSED ***"
- GOTO 9999
- 1999 REM TESTCASE, EXPECTED ERROR, EXPECTED RESULT, PARAMETERS...
- DATA 1 , 0 , 2.22507E-308 , 0
- DATA 2 , 0 , 2.22507E-308 , 1
- DATA 3 , 0 , 2.22507E-308 , -1
- DATA 4 , 0 , 2.22507E-308 , .4
- DATA 5 , 0 , 2.22507E-308 , -.4
- DATA 6 , 0 , 2.22507E-308 , .6
- DATA 7 , 0 , 2.22507E-308 , -.6
- DATA 8 , 0 , 2.22507E-308 , 254
- DATA 9 , 0 , 2.22507E-308 , 255
- DATA 10 , 0 , 2.22507E-308 , 256
- DATA 11 , 0 , 2.22507E-308 , 32000
- DATA 12 , 0 , 2.22507E-308 , -.227229
- DATA 13 , 0 , 2.22507E-308 , -.239157
- DATA 14 , 0 , 2.22507E-308 , -.213586
- DATA 15 , 0 , 2.22507E-308 , .274675
- DATA 16 , 0 , 2.22507E-308 , .169766
- DATA 17 , 0 , 2.22507E-308 , .318766
- DATA 18 , 0 , 2.22507E-308 , 2.06658E-2
- DATA 19 , 0 , 2.22507E-308 , .188257
- DATA 20 , 0 , 2.22507E-308 , -.277537
- DATA 21 , 0 , 2.22507E-308 , -.481303
- DATA 22 , 0 , 2.22507E-308 , .43556
- DATA 23 , 0 , 2.22507E-308 , -.210971
- DATA 24 , 0 , 2.22507E-308 , -.455216
- DATA 25 , 0 , 2.22507E-308 , -110.907
- DATA 26 , 0 , 2.22507E-308 , 105.632
- DATA 27 , 0 , 2.22507E-308 , -114.341
- DATA 28 , 0 , 2.22507E-308 , 109.706
- DATA 29 , 0 , 2.22507E-308 , 109.198
- DATA 30 , 0 , 2.22507E-308 , 85.8773
- DATA 31 , 0 , 2.22507E-308 , -58.3548
- DATA 32 , 0 , 2.22507E-308 , 29.6397
- DATA 33 , 0 , 2.22507E-308 , -108.36
- DATA 34 , 0 , 2.22507E-308 , -46.5199
- DATA 35 , 0 , 2.22507E-308 , 112.521
- DATA 36 , 0 , 2.22507E-308 , 45.4151
- DATA 37 , 0 , 2.22507E-308 , 101.129
- DATA 38 , 0 , 2.22507E-308 , 65.0473
- DATA 39 , 0 , 2.22507E-308 , 48.4012
- DATA 40 , 0 , 2.22507E-308 , 122.294
- DATA 41 , 0 , 2.22507E-308 , -56.1094
- DATA 42 , 0 , 2.22507E-308 , -121.087
- DATA 43 , 0 , 2.22507E-308 , -123.517
- DATA 44 , 0 , 2.22507E-308 , -97.6301
- DATA 45 , 0 , 2.22507E-308 , -64.0001
- DATA 46 , 0 , 2.22507E-308 , -25.6888
- DATA 47 , 0 , 2.22507E-308 , 14.8006
- DATA 48 , 0 , 2.22507E-308 , -61.0877
- DATA 49 , 0 , 2.22507E-308 , -66.6381
- DATA 50 , 0 , 2.22507E-308 , -5476.5
- DATA 51 , 0 , 2.22507E-308 , -21210.3
- DATA 52 , 0 , 2.22507E-308 , -28757.2
- DATA 53 , 0 , 2.22507E-308 , -28732.2
- DATA 54 , 0 , 2.22507E-308 , 12730.3
- DATA 55 , 0 , 2.22507E-308 , -1830.69
- DATA 56 , 0 , 2.22507E-308 , 5486.39
- DATA 57 , 0 , 2.22507E-308 , 22405.9
- DATA 58 , 0 , 2.22507E-308 , 30809.8
- DATA 59 , 0 , 2.22507E-308 , -28930.6
- DATA 60 , 0 , 2.22507E-308 , -6014.53
- DATA 61 , 0 , 2.22507E-308 , 17414.6
- DATA 62 , 0 , 2.22507E-308 , -10538.3
- DATA 63 , 0 , 2.22507E-308 , -17536.3
- DATA 64 , 0 , 2.22507E-308 , -8856.62
- DATA 65 , 0 , 2.22507E-308 , -5140.12
- DATA 66 , 0 , 2.22507E-308 , -8595.31
- DATA 67 , 0 , 2.22507E-308 , -3382.87
- DATA 68 , 0 , 2.22507E-308 , -5002.07
- DATA 69 , 0 , 2.22507E-308 , -5800.72
- DATA 70 , 0 , 2.22507E-308 , 29686.4
- DATA 71 , 0 , 2.22507E-308 , 2571.
- DATA 72 , 0 , 2.22507E-308 , 31091.
- DATA 73 , 0 , 2.22507E-308 , 14819.
- DATA 74 , 0 , 2.22507E-308 , 3790.9
- DATA 75 , 0 , 2.22507E-308 , -4.2981E+9
- DATA 76 , 0 , 2.22507E-308 , -7.05453E+8
- DATA 77 , 0 , 2.22507E-308 , -3.10179E+9
- DATA 78 , 0 , 2.22507E-308 , -4.86159E+9
- DATA 79 , 0 , 2.22507E-308 , -8.62908E+8
- DATA 80 , 0 , 2.22507E-308 , -3.4101E+9
- DATA 81 , 0 , 2.22507E-308 , 3.3889E+9
- DATA 82 , 0 , 2.22507E-308 , 2.49826E+9
- DATA 83 , 0 , 2.22507E-308 , 2.3491E+9
- DATA 84 , 0 , 2.22507E-308 , 1.94745E+8
- DATA 85 , 0 , 2.22507E-308 , 2.02475E+9
- DATA 86 , 0 , 2.22507E-308 , -2.26748E+9
- DATA 87 , 0 , 2.22507E-308 , -2.10587E+9
- DATA 88 , 0 , 2.22507E-308 , 4.23585E+9
- DATA 89 , 0 , 2.22507E-308 , -2.66524E+9
- DATA 90 , 0 , 2.22507E-308 , 4.01052E+9
- DATA 91 , 0 , 2.22507E-308 , -4.87912E+9
- DATA 92 , 0 , 2.22507E-308 , 1.77556E+9
- DATA 93 , 0 , 2.22507E-308 , 2.87705E+8
- DATA 94 , 0 , 2.22507E-308 , 1.99977E+8
- DATA 95 , 0 , 2.22507E-308 , -3.39941E+9
- DATA 96 , 0 , 2.22507E-308 , -3.49119E+9
- DATA 97 , 0 , 2.22507E-308 , -2.86324E+9
- DATA 98 , 0 , 2.22507E-308 , 4.20418E+9
- DATA 99 , 0 , 2.22507E-308 , -3.1518E+9
- DATA 100 , 0 , 2.22507E-308 , 4.60615E+9
- DATA 0
- 9000 REM ERROR HANDLER
- IF ERL = 999 THEN
- F = ABS(SGN(ERR))
- RESUME NEXT
- END IF
- PRINT "*** UNEXPECTED ERROR ON LINE ";ERL;" ***"
- 9999 END
|