home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / maths / progs / evaluator / !Evaluator / !Help < prev    next >
Encoding:
Text File  |  1989-09-24  |  3.3 KB  |  125 lines

  1. Evaluator: A programmable expression evaluator
  2. ==============================================
  3.  
  4. Evaluator is a small RISC OS-application that evaluates numerical expres-
  5. sions. It also can handle userdefined functions in this expressions!
  6.  
  7. It simulates the EVAL-function of BASIC: it is like you are at the BASIC
  8. prompt evaluating expressions. (In fact the program uses the EVAL-function:
  9. see below.) The program expects input from the keyboard, for instance the
  10. numeric keypad. After a Return (or a click on the EXE-button) the result
  11. will be shown in the window. If you are not satisfied with the expression
  12. you can edit it: you can place the caret at every position in the expression
  13. you want.
  14.  
  15. In an expression are allowed:
  16.  
  17. Arithmetical operators (see below)
  18. Variables (see below)
  19. Decimal constants:
  20.     x or xEn
  21.     (with x a real or integer, n an integer)
  22. Hexadecimal constants:
  23.     &x
  24.     (with x a hexadecimal number)
  25. Binary constants:
  26.     %x
  27.     (with x a binary number)
  28. Functions:
  29.     SIN COS TAN ASN ACS ATN DEG RAD
  30.     SQR LN LOG EXP
  31.     INT ABS SGN
  32.     RND PI
  33.     LEN ASC
  34. Userdefined functions:
  35.     FNx with x the name of the function
  36.  
  37. Don't forget the multiplication operator when you use brackets: 2*(3+4)
  38. instead of 2(3+4).
  39.  
  40. Numerical expressions give numerical results. Additionally you can assign
  41. a numerical result to a variable. 26 variables are defined: from a to z.
  42. Allowed is an assignment-statement like:
  43. <variable> = <expression>
  44. From then you can use <variable> in any expression.
  45.  
  46. For more information about expressions: see the BBC BASIC user guide.
  47.  
  48. Userdefined functions
  49. ---------------------
  50.  
  51. This expression evaluator is programmable! You can program your own
  52. functions and use them in the expressions. For instance: if you program
  53. the function FNfac(x) to calculate the faculty of x, you can use this
  54. function in expressions like:
  55. FNfac(6)/FNfac(4)
  56. How do you program userdefined functions? You simply program them in BASIC
  57. and save the program as UserFN. This library of functions will be loaded
  58. by the Evaluator-program, when you execute it. A UserFN-library must always
  59. exist in the same directory as Evaluator is located, otherwise an error will
  60. result.
  61.  
  62. Every function which gives a numerical result is allowed. For an expla-
  63. nation of functions: see the BBC BASIC user guide.
  64.  
  65. Priority
  66. --------
  67.  
  68. The priority of the operators is as follows:
  69.  
  70. 1  - +             unary minus and plus
  71.    SIN etc.        functions
  72.    ( )             brackets
  73. 2  ^               raise to the power
  74. 3  * / DIV MOD     multiplication, division, integer
  75.                    division and integer remainder
  76. 4  + -             addition and subtraction
  77.  
  78. Buttons in window
  79. -----------------
  80.  
  81. The meaning of the three buttons in the window of Evaluator is as
  82. follows:
  83. C   : clears the expression,
  84. MC  : clears the memory, i.e. the 26 variables,
  85. EXE : executes the expression (same function as Return on the key-
  86.       board).
  87.    
  88. Examples
  89. --------
  90.  
  91. Here are some examples of numerical expressions:
  92.  
  93. 12+3*4^2
  94. 12+(3*(4^2))
  95. 2.1E-3/12
  96. 4*1024*1024
  97. (-24+SQR(24^2-4*3*5))/(2*3)
  98. 12^3
  99. x=3.56*PI
  100. x/2
  101. z=LOG(100)/LN(2)
  102.  
  103. COS(RAD(45))
  104. ABS(2*4-5*7)
  105.  
  106. Number conversion:
  107.  
  108. &EF
  109. %1010010
  110.  
  111. ASCII codes:
  112.  
  113. ASC("A")
  114.  
  115.  
  116. Walther Schoonenberg
  117.  
  118.  
  119. Send comments and suggestions to:
  120.  
  121. Walther Schoonenberg
  122. Brouwersgracht 190 C
  123. 1013 HC Amsterdam
  124. The Netherlands
  125.