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.
 
 
 
 
 
 

50 lines
1.8 KiB

  1. 1000 rem ------------------------------------------
  2. 1010 rem Filename: cot1.bas
  3. 1020 rem Purpose: Verify COT()
  4. 1100 rem ------------------------------------------
  5. 1120 X = 0.0001
  6. 1130 RESULT = COT( X )
  7. 1140 print "The cotangent value of "; X; " is"; RESULT
  8. 1150 if RESULT < 9999.9999666 then goto TestFailed
  9. 1160 if RESULT > 9999.9999668 then goto TestFailed
  10. 1170 print "*** TEST #1 PASSED ***"
  11. 1200 rem ------------------------------------------
  12. 1220 X = 0.5
  13. 1230 RESULT = COT( X )
  14. 1240 print "The cotangent value of "; X; " is"; RESULT
  15. 1250 if RESULT < 1.8304876 then goto TestFailed
  16. 1260 if RESULT > 1.8304878 then goto TestFailed
  17. 1270 print "*** TEST #2 PASSED ***"
  18. 1300 rem ------------------------------------------
  19. 1320 X = -0.5
  20. 1330 RESULT = COT( X )
  21. 1340 print "The cotangent value of "; X; " is"; RESULT
  22. 1350 if RESULT > -1.8304876 then goto TestFailed
  23. 1360 if RESULT < -1.8304878 then goto TestFailed
  24. 1370 print "*** TEST #3 PASSED ***"
  25. 1400 rem ------------------------------------------
  26. 1420 X = 1
  27. 1430 RESULT = COT( X )
  28. 1440 print "The cotangent value of "; X; " is"; RESULT
  29. 1450 if RESULT < 0.6420925 then goto TestFailed
  30. 1460 if RESULT > 0.6420927 then goto TestFailed
  31. 1470 print "*** TEST #4 PASSED ***"
  32. 1500 rem ------------------------------------------
  33. 1520 X = -1
  34. 1530 RESULT = COT( X )
  35. 1540 print "The cotangent value of "; X; " is"; RESULT
  36. 1550 if RESULT > -0.6420925 then goto TestFailed
  37. 1560 if RESULT < -0.6420927 then goto TestFailed
  38. 1570 print "*** TEST #5 PASSED ***"
  39. 8000 rem ------------------------------------------
  40. 8010 TestPassed:
  41. 8020 print "*** ALL TESTS PASSED ***"
  42. 8030 goto TheEnd
  43. 8500 rem ------------------------------------------
  44. 8510 TestFailed:
  45. 8520 print "*** TEST FAILED ***"
  46. 8530 goto TheEnd
  47. 9000 rem ------------------------------------------
  48. 9010 TheEnd:
  49. 9999 end