home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / educatio / eval103.zip / EVAL.DOC next >
Text File  |  1991-12-12  |  10KB  |  261 lines

  1.  
  2.  
  3.  
  4.      EVAL V1.03 Copyright (c) 1991 Copy Con Incorporated             Page 1
  5.  
  6.  
  7.      OVERVIEW
  8.      --------
  9.      EVAL is a mathematical expression evaluator, capable of evaluating
  10.      virtually any formula, including those with trigonometric functions
  11.      and user-defined variables. Formulas are typed in at the command line,
  12.      and the formula and outcome (and optionally the variable values) are
  13.      immediately displayed on your screen, or can be sent elsewhere via
  14.      standard DOS redirection.
  15.  
  16.  
  17.      DISCLAIMER
  18.      ----------
  19.      EVAL is distributed on an "AS IS" basis without warranty, expressed or
  20.      implied. Considerable testing effort has been expended, but the user
  21.      is advised to check the program's suitability before relying on it.
  22.      The user assumes full risk as to the results of using this program.
  23.      Any liability of the author will be limited exclusively to product
  24.      replacement. In no event shall the author be liable for any
  25.      consequential damages arising from the use, or inability to use this
  26.      program.
  27.  
  28.  
  29.      REGISTRATION
  30.      ------------
  31.      EVAL is NOT free - it is being offered to you as Shareware. If you
  32.      plan to continue using EVAL, you are obligated to pay the modest
  33.      registration fee of $15. For the latest version of EVAL, minus the
  34.      "nag" messages, add $5.
  35.  
  36.      Send check or money order in U.S. funds to:
  37.  
  38.         Copy Con Incorporated
  39.         P.O. Box 23255
  40.         Baltimore, MD 21203
  41.  
  42.      Specify 5.25" or 3.5" diskette. Maryland residents add $1 sales tax.
  43.      We thank you for your support.
  44.  
  45.  
  46.  
  47.      EVAL V1.03 Copyright (c) 1991 Copy Con Incorporated             Page 2
  48.  
  49.  
  50.      OPERATION
  51.      ---------
  52.      EVAL is activated from the command line, using the format
  53.  
  54.         EVAL [variable=expression;...] expression [options]
  55.  
  56.      Expressions are mathematical formulas built with the supported
  57.      functions, operators, constants and variables.
  58.  
  59.  
  60.      FUNCTIONS
  61.      ---------
  62.      Following is the list of functions that EVAL supports:
  63.  
  64.         Function  Description
  65.         --------  -----------
  66.           abs     Absolute value
  67.           acos    Arc cosine
  68.           asin    Arc sine
  69.           atan    Arc tangent
  70.           ceil    Smallest integer not less than input value (rounds up)
  71.           cos     Cosine
  72.           cosh    Hyperbolic cosine
  73.           csc     Cosecant
  74.           ctn     Cotangent
  75.           cub     Cube root
  76.           exp     E to the power of input value
  77.           flr     Largest integer not more than input value (rounds down)
  78.           int     Rounds down (same as FLR)
  79.           ln      natural logarithm
  80.           log     natural logarithm (same as LN)
  81.           logt    Base 10 logarithm
  82.           sec     Secant
  83.           sgn     Sign of input value (positive=1, negative=-1, zero=0)
  84.           sin     Sine
  85.           sinh    Hyperbolic sine
  86.           sqr     Square root
  87.           tan     Tangent
  88.           tanh    Hyperbolic tangent
  89.  
  90.      Parentheses are optional when using functions; if they are not used,
  91.      only the first value following the function will be considered for
  92.      input. For example:
  93.  
  94.         sin pi      is equivalent to   sin(pi)
  95.         sin pi/2    is equivalent to   sin(pi)/2
  96.         sin(pi/2)   is equivalent to   sin(pi/2)
  97.  
  98.  
  99.  
  100.      EVAL V1.03 Copyright (c) 1991 Copy Con Incorporated             Page 3
  101.  
  102.  
  103.      OPERATORS
  104.      ---------
  105.      Each operator has a precedence, and operators with higher precedence
  106.      are evaluated before operators with lower precedence. Operators with
  107.      equal precedence are handled from left to right within a function.
  108.  
  109.      Following is the list of operators that EVAL supports, along with
  110.      their precedences:
  111.  
  112.         Operator  Precedence  Description
  113.         --------  ----------  -----------
  114.            (          5       Left parenthesis
  115.            )          5       Right parenthesis
  116.            !          4       Factorial
  117.            ^          3       Exponential
  118.            *          2       Multiplication
  119.            /          2       Division
  120.            %          2       Modulus
  121.            +          1       Addition
  122.            -          1       Subtraction
  123.  
  124.  
  125.      CONSTANTS
  126.      ---------
  127.      EVAL supports numeric constants, as well as two alphabetic constants,
  128.      PI and E. Alphabetic constants cannot directly follow functions; use
  129.      "sin pi" or "sin(pi)", not "sinpi". Numeric constants need not be
  130.      separated from functions; "sin3" is okay.
  131.  
  132.      Here are the approximate values of PI and E:
  133.  
  134.         PI = 3.14159265
  135.         E  = 2.71828183
  136.  
  137.  
  138.      VARIABLES
  139.      ---------
  140.      The letters A-Z (except for E and I) are set aside as user-definable
  141.      variables. Variables have a default value of 0, and are assigned
  142.      values using the equals sign. For example:
  143.  
  144.         EVAL a=pi;b=2;b*cos(a)
  145.  
  146.      will assign a value of PI to A, a value of 2 to B, and will print out
  147.      the value of B times the cosine of A. As with alphabetic constants,
  148.      variables cannot directly follow functions; use a space delimiter, or
  149.      parentheses as above.
  150.  
  151.  
  152.  
  153.      EVAL V1.03 Copyright (c) 1991 Copy Con Incorporated             Page 4
  154.  
  155.  
  156.      OPTIONS
  157.      -------
  158.      Options must be in the form "OPTION:value", as in "a:g" or "d:5". Case
  159.      is not important. Separate options with spaces.
  160.  
  161.      Option  Description
  162.      ------  -----------
  163.        A     Angular unit - whether angles will be expressed as degrees,
  164.              radians, or grads. Use the first letter of the unit, as in
  165.              "a:d". By default, angular units are expressed as radians.
  166.  
  167.        D     Significant Digits - the number of significant digits shown in
  168.              the expression outcome. Range is 1 thru 20; the default is to
  169.              display as many digits as needed.
  170.  
  171.        V     Show Variables - whether variables and their values will be
  172.              displayed as they are assigned values; default is N.
  173.  
  174.  
  175.      ERROR MESSAGES
  176.      --------------
  177.      Following is the list of error messages you may have the misfortune to
  178.      see, along with their descriptions and corresponding DOS errorlevels:
  179.  
  180.      Level  Message & Description
  181.      -----  ---------------------
  182.        1    Invalid command line options - you have attempted to use an
  183.             unsupported option, or you have exceeded an option's range.
  184.  
  185.        2    Invalid function '(function)' - you have attempted to use an
  186.             unsupported function. If it's a common function, let us know,
  187.             and we will add it.
  188.  
  189.        3    Abnormal program termination - either we erred in trapping a
  190.             math function, or the program has been corrupted somehow.
  191.             (Please drop us a line describing everything that led up to
  192.             this error, if you happen to come across it.)
  193.  
  194.        4    Expression too complex - your formula has 128 or more
  195.             constants, or more than 255 combined constants, functions, and
  196.             operators.
  197.  
  198.        5    Invalid operator '(op)' - you have attempted to use an
  199.             unsupported operator. If it's a common operator, let us know,
  200.             and we will add it.
  201.  
  202.        6    Mixmatched parentheses - there were an uneven amount of
  203.             parentheses, or a right parenthesis was encountered before its
  204.             matching left paren.
  205.  
  206.  
  207.  
  208.      EVAL V1.03 Copyright (c) 1991 Copy Con Incorporated             Page 5
  209.  
  210.  
  211.      ERROR MESSAGES (continued)
  212.      --------------------------
  213.        7    Invalid use of functions - functions cannot be directly
  214.             followed by an operator (unless the operator is a "+" or "-"
  215.             indicating the sign of the value that follows).
  216.  
  217.        8    Invalid use of operators - operators cannot be directly
  218.             followed by other operators (unless the second operator is a
  219.             "+" or "-" indicating the sign of the value that follows).
  220.  
  221.        9    Domain/range error - a function in the formula cannot evaluate
  222.             its input value, as the value is outside of the function's
  223.             range.
  224.  
  225.       10    Division by zero - a denominator in your formula has a value of
  226.             zero, which is mathematically undefined.
  227.  
  228.       11    Overflow error - the formula evaluates to a number higher than
  229.             the maximum value allowed, or lower than the minimum allowed.
  230.  
  231.       12    Invalid variable '(variable)' - an attempt was made to assign a
  232.             value to a constant or a non-variable.
  233.  
  234.  
  235.      EXAMPLES
  236.      --------
  237.      EVAL sqr3 d:4
  238.           displays the square root of 3, limited to 4 significant digits.
  239.           ( sqr3 is equivalent to sqr(3) )
  240.  
  241.      EVAL a=pi ; b=2 ; b*cos(a) v:y
  242.           assigns a value of PI to A, a value of 2 to B, and displays the
  243.           value of B times the cosine of A. The values of A and B are also
  244.           displayed. (The spaces around the semicolons are not required)
  245.  
  246.      EVAL x=.1 ; asin(5x) a:d
  247.           assigns a value of .1 to X, and displays the arcsine of quantity
  248.           5 times X, expressed in degrees. ( 5x is equivalent to 5*x )
  249.  
  250.  
  251.      CORRESPONDENCE
  252.      --------------
  253.      If you have any comments, suggestions, bug reports, etc., write to:
  254.  
  255.         Copy Con Incorporated
  256.         P.O. Box 23255
  257.         Baltimore, MD 21203
  258.  
  259.      If you would like a reply, please include a self-addressed, stamped
  260.      envelope. We look forward to hearing from you.
  261.