home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1994 September / Simtel-MSDOS-Sep1994-CD2.iso / disc2 / turbopas / eval.hlp < prev    next >
Text File  |  1986-04-04  |  1KB  |  59 lines

  1.  
  2. Eval does arithmetic from the command line.  For example,
  3.  
  4.      eval 2*3
  5.  
  6. prints the answer 6.
  7.  
  8. Eval accepts the following infix binary operators:
  9.  
  10.     +        add
  11.     -        subtract
  12.     *        multiply
  13.     /        divide
  14.     \        mod  (remainder of integer division)
  15.     ^        power
  16.     max        maximum
  17.     min        minimum
  18.  
  19. Parentheses may be used for grouping.
  20.  
  21. Eval also accepts the following unary prefix operators:
  22.  
  23.     +        unary plus
  24.     -        unary minus
  25.     abs        absolute value
  26.     round    rounding to integer
  27.     trunc    truncating to integer
  28.     sqrt    square root
  29.     sqr        square
  30.     sin        \
  31.     cos         \
  32.     tan          trig functions in radians
  33.     arcsin      for example, eval sin 3.14159265 prints 0.00000000358979
  34.     arccos      and eval sin(3.14159265 / 2) prints 1
  35.     arctan         \
  36.     sinh          \
  37.     cosh           \
  38.     tanh            \
  39.     ln        natural log
  40.     log        base 10 log
  41.     log2    base 2 log
  42.     exp        raise to a power
  43.     fact    factorial
  44.  
  45.  
  46. The expression evaluation code is derived from the public domain spreadsheet
  47. included with Turbo Pascal.
  48.  
  49. Note that some versions of Microsoft pascal incorrectly decide that your pc
  50. has an 8087 or 80287 math coprocessor when in fact it doesn't.  To check this,
  51. try a simple multiplication.  If eval 2*3 says 2, rather than 6, set the
  52. environment variable
  53.  
  54.    set NO87=X
  55.  
  56. in your autoexec.bat file.  (I use a blank in place of the X.)
  57.  
  58.  
  59.