ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

184 lines
4.8 KiB

  1. REM ------------------------------------------------------------
  2. REM PURPOSE: TEST THE PARAMETER RANGE CHECKS
  3. REM AUTHOR: HOWARD WULF, AF5NE
  4. REM GENERATED: 02/21/2015 14:08:15
  5. REM FILENAME: F_ASIN_X_N.BAS
  6. REM SYNTAX: N = ASIN( X )
  7. REM UNIQUEID: F_ASIN_X_N
  8. REM FUNCTION: ASIN
  9. REM
  10. REM VARIABLE DESCRIPTION
  11. REM I CURRENT TESTCASE NUMBER
  12. REM E EXPECTED ERROR FLAG
  13. REM F ACTUAL ERROR FLAG
  14. REM R EXPECTED FUNCTION RESULT
  15. REM N ACTUAL FUNCTION RESULT
  16. REM X ACTUAL FUNCTION PARAMETER
  17. REM
  18. RESTORE 2000
  19. REM GET TESTCASE #
  20. READ I
  21. WHILE I > 0
  22. REM GET TESTCASE DATA
  23. READ E, R, X
  24. REM DISPLAY TESTCASE DATA
  25. PRINT "TESTCASE #";I,"E=";E,"R=";R, "X=";X
  26. REM EXECUTE TESTCASE
  27. N = 0
  28. S$ = ""
  29. ON ERROR GOTO 9000
  30. F = 0
  31. 999 N = ASIN( X )
  32. ERROR 0
  33. REM DISPLAY TESTCASE RESULTS
  34. PRINT ,"F=";F,"N=";N
  35. REM VERIFY EXPECTED ERROR
  36. IF E <> F THEN
  37. PRINT "*** TEST FAILED, EXCEPTION MISMATCH ***"
  38. STOP
  39. END IF
  40. REM VERIFY EXPECTED RESULT
  41. IF R > 0 THEN
  42. LET RMIN = 0.99 * R
  43. IF R > MAXNUM / 1.012 THEN
  44. LET RMAX = MAXNUM
  45. ELSE
  46. LET RMAX = 1.01 * R
  47. END IF
  48. END IF
  49. IF R < 0 THEN
  50. IF R < - MAXNUM / 1.012 THEN
  51. LET RMIN = -MAXNUM
  52. ELSE
  53. LET RMIN = 1.01 * R
  54. END IF
  55. LET RMAX = 0.99 * R
  56. END IF
  57. IF R = 0 THEN
  58. LET RMIN = -.01
  59. LET RMAX = +.01
  60. END IF
  61. IF N < RMIN THEN
  62. PRINT "*** TEST FAILED, RESULT MISMATCH ***"
  63. STOP
  64. END IF
  65. IF N > RMAX THEN
  66. PRINT "*** TEST FAILED, RESULT MISMATCH ***"
  67. STOP
  68. END IF
  69. PRINT "*** TEST PASSED ***"
  70. REM GET NEXT TESTCASE #
  71. READ I
  72. WEND
  73. PRINT "*** ALL TESTS PASSED ***"
  74. GOTO 9999
  75. 1999 REM TESTCASE, EXPECTED ERROR, EXPECTED RESULT, PARAMETERS...
  76. DATA 1 , 0 , 0 , 0
  77. DATA 2 , 0 , 1.5708 , 1
  78. DATA 3 , 0 , -1.5708 , -1
  79. DATA 4 , 0 , .411517 , .4
  80. DATA 5 , 0 , -.411517 , -.4
  81. DATA 6 , 0 , .643501 , .6
  82. DATA 7 , 0 , -.643501 , -.6
  83. DATA 8 , 1 , 0 , 254
  84. DATA 9 , 1 , 0 , 255
  85. DATA 10 , 1 , 0 , 256
  86. DATA 11 , 1 , 0 , 32000
  87. DATA 12 , 0 , -.229231 , -.227229
  88. DATA 13 , 0 , -.241498 , -.239157
  89. DATA 14 , 0 , -.215244 , -.213586
  90. DATA 15 , 0 , .278252 , .274675
  91. DATA 16 , 0 , .170592 , .169766
  92. DATA 17 , 0 , .324427 , .318766
  93. DATA 18 , 0 , 2.06673E-2 , 2.06658E-2
  94. DATA 19 , 0 , .189387 , .188257
  95. DATA 20 , 0 , -.281229 , -.277537
  96. DATA 21 , 0 , -.502141 , -.481303
  97. DATA 22 , 0 , .45066 , .43556
  98. DATA 23 , 0 , -.212568 , -.210971
  99. DATA 24 , 0 , -.472615 , -.455216
  100. DATA 25 , 1 , 0 , -110.907
  101. DATA 26 , 1 , 0 , 105.632
  102. DATA 27 , 1 , 0 , -114.341
  103. DATA 28 , 1 , 0 , 109.706
  104. DATA 29 , 1 , 0 , 109.198
  105. DATA 30 , 1 , 0 , 85.8773
  106. DATA 31 , 1 , 0 , -58.3548
  107. DATA 32 , 1 , 0 , 29.6397
  108. DATA 33 , 1 , 0 , -108.36
  109. DATA 34 , 1 , 0 , -46.5199
  110. DATA 35 , 1 , 0 , 112.521
  111. DATA 36 , 1 , 0 , 45.4151
  112. DATA 37 , 1 , 0 , 101.129
  113. DATA 38 , 1 , 0 , 65.0473
  114. DATA 39 , 1 , 0 , 48.4012
  115. DATA 40 , 1 , 0 , 122.294
  116. DATA 41 , 1 , 0 , -56.1094
  117. DATA 42 , 1 , 0 , -121.087
  118. DATA 43 , 1 , 0 , -123.517
  119. DATA 44 , 1 , 0 , -97.6301
  120. DATA 45 , 1 , 0 , -64.0001
  121. DATA 46 , 1 , 0 , -25.6888
  122. DATA 47 , 1 , 0 , 14.8006
  123. DATA 48 , 1 , 0 , -61.0877
  124. DATA 49 , 1 , 0 , -66.6381
  125. DATA 50 , 1 , 0 , -5476.5
  126. DATA 51 , 1 , 0 , -21210.3
  127. DATA 52 , 1 , 0 , -28757.2
  128. DATA 53 , 1 , 0 , -28732.2
  129. DATA 54 , 1 , 0 , 12730.3
  130. DATA 55 , 1 , 0 , -1830.69
  131. DATA 56 , 1 , 0 , 5486.39
  132. DATA 57 , 1 , 0 , 22405.9
  133. DATA 58 , 1 , 0 , 30809.8
  134. DATA 59 , 1 , 0 , -28930.6
  135. DATA 60 , 1 , 0 , -6014.53
  136. DATA 61 , 1 , 0 , 17414.6
  137. DATA 62 , 1 , 0 , -10538.3
  138. DATA 63 , 1 , 0 , -17536.3
  139. DATA 64 , 1 , 0 , -8856.62
  140. DATA 65 , 1 , 0 , -5140.12
  141. DATA 66 , 1 , 0 , -8595.31
  142. DATA 67 , 1 , 0 , -3382.87
  143. DATA 68 , 1 , 0 , -5002.07
  144. DATA 69 , 1 , 0 , -5800.72
  145. DATA 70 , 1 , 0 , 29686.4
  146. DATA 71 , 1 , 0 , 2571.
  147. DATA 72 , 1 , 0 , 31091.
  148. DATA 73 , 1 , 0 , 14819.
  149. DATA 74 , 1 , 0 , 3790.9
  150. DATA 75 , 1 , 0 , -4.2981E+9
  151. DATA 76 , 1 , 0 , -7.05453E+8
  152. DATA 77 , 1 , 0 , -3.10179E+9
  153. DATA 78 , 1 , 0 , -4.86159E+9
  154. DATA 79 , 1 , 0 , -8.62908E+8
  155. DATA 80 , 1 , 0 , -3.4101E+9
  156. DATA 81 , 1 , 0 , 3.3889E+9
  157. DATA 82 , 1 , 0 , 2.49826E+9
  158. DATA 83 , 1 , 0 , 2.3491E+9
  159. DATA 84 , 1 , 0 , 1.94745E+8
  160. DATA 85 , 1 , 0 , 2.02475E+9
  161. DATA 86 , 1 , 0 , -2.26748E+9
  162. DATA 87 , 1 , 0 , -2.10587E+9
  163. DATA 88 , 1 , 0 , 4.23585E+9
  164. DATA 89 , 1 , 0 , -2.66524E+9
  165. DATA 90 , 1 , 0 , 4.01052E+9
  166. DATA 91 , 1 , 0 , -4.87912E+9
  167. DATA 92 , 1 , 0 , 1.77556E+9
  168. DATA 93 , 1 , 0 , 2.87705E+8
  169. DATA 94 , 1 , 0 , 1.99977E+8
  170. DATA 95 , 1 , 0 , -3.39941E+9
  171. DATA 96 , 1 , 0 , -3.49119E+9
  172. DATA 97 , 1 , 0 , -2.86324E+9
  173. DATA 98 , 1 , 0 , 4.20418E+9
  174. DATA 99 , 1 , 0 , -3.1518E+9
  175. DATA 100 , 1 , 0 , 4.60615E+9
  176. DATA 0
  177. 9000 REM ERROR HANDLER
  178. IF ERL = 999 THEN
  179. F = ABS(SGN(ERR))
  180. RESUME NEXT
  181. END IF
  182. PRINT "*** UNEXPECTED ERROR ON LINE ";ERL;" ***"
  183. 9999 END