home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / RXMATH.ZIP / RXMATHFN.DOC < prev   
Text File  |  1992-10-19  |  3KB  |  99 lines

  1.  
  2.                       (C) Copyright IBM Corp. 1992
  3.  
  4.                                 RxMathFn
  5.  
  6.                Basic Mathematic Functions for use with OS/2 REXX
  7.  
  8.                      OS/2 2.0 Rexx Math Function Package
  9.                                    by
  10.                            Patrick J. Mueller
  11.  
  12. The following functions are provided in RxMathFn.  Note that these
  13. functions are a subset of those available with the C Set/2 compiler.
  14. All trigonometric functions deal with radians.  All functions return
  15. strings with a C Set/2 "double" precision of 15 digits after decimal
  16. point, or in scientific notation if neccessary.  If you have shorter
  17. precision (NUMERIC DIGITS) set in your REXX environment, the value
  18. returned from RxMathFn functions will be converted by REXX at the
  19. first use in arithmetic operation,
  20.  
  21.    cos(x)     - cosine of x
  22.    sin(x)     - sine of x
  23.    tan(x)     - tangent of x
  24.  
  25.    acos(x)    - arc cosine of x
  26.    asin(x)    - arc sine of x
  27.    atan(x)    - arc tangent of x
  28.  
  29.    cosh(x)    - hyperbolic cosine of x
  30.    sinh(x)    - hyperbolic sine of x
  31.    tanh(x)    - hyperbolic tangent of x
  32.  
  33.    ceil(x)    - smallest integer >= x
  34.    floor(x)   - largest  integer <= x
  35.  
  36.    exp(x)     - e to the power x (e is natural logarithm base)
  37.    log(x)     - natural logarithm of x
  38.    log10(x)   - base 10 logarithm of x
  39.  
  40.    sqrt(x)    - square root of x
  41.    pow(x,y)   - x to the power y
  42.  
  43.    pi()       - the value of pi
  44.    e()        - the value of e
  45.  
  46. ==============================
  47. Files included into RxMath.Zip
  48. ==============================
  49. LICENSE.TXT    -  License agreement
  50. RXMATH.ABS     -  Abstract
  51. RXMATHFN.DOC   -  This file
  52. RXMATHFN.CMD   -  Example of use
  53. RXMATHFN.DLL   -  Compiled code
  54.  
  55.  
  56. ============
  57. Installation
  58. ============
  59. To register all the math functions in RxMathFn.dll, you need to
  60. execute the following function calls in REXX:
  61.  
  62.    rc = RxFuncAdd("MathLoadFuncs","RxMathFn","MathLoadFuncs")
  63.    rc = MathLoadFuncs()
  64.  
  65. The first statement registers the MathLoadFuncs function in RxMathFn,
  66. and the second statement calls the MathLoadFuncs function to load in
  67. the rest of the functions.  You may call these functions as often
  68. as you like, but you only need to do it once until the next time your
  69. computer is re-booted.
  70.  
  71. MathLoadFuncs displays copyright information.  To suppress it call it
  72. with the "Quiet" parameter.
  73.    rc = MathLoadFuncs("Quiet")
  74.  
  75. ============
  76. Removal
  77. ============
  78. Once RxMathFn.dll has been installed, and you need to remove it from
  79. memory to either delete the DLL or to replace it, you need to execute
  80. the Rexx function MathDropFuncs() within Rexx.  This will unregister
  81. all the math functions.  You then need to exit all currently running
  82. CMD.EXE sessions.  Once you've done this, the DLL will be dropped from
  83. the system, and you will be able to remove or replace it.
  84.  
  85.  
  86. ===============
  87. Special strings
  88. ===============
  89.  
  90. Two special strings can be returned as the result from RxMathFn
  91. functions:
  92.  
  93.  - "nan"      - defined as the result of 0/0;
  94.  - "infinity" - defined as the result of 1/0.
  95.  
  96. Both of the special strings can be preceded with the minus sign to
  97. indicate negative result ( -1/0 ).
  98.  
  99.