home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / rexx / 656 < prev    next >
Encoding:
Text File  |  1992-07-26  |  2.3 KB  |  59 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!ALBANY.BITNET!BEC
  3. Organization: University at Albany Computing Services
  4. X-Acknowledge-To: <BEC@ALBANY>
  5. Message-ID: <920726.212719.EDT.BEC@ALBANY>
  6. Newsgroups: comp.lang.rexx
  7. Date:         Sun, 26 Jul 1992 21:27:19 EDT
  8. Sender:       REXX Programming discussion list <REXXLIST@UGA.BITNET>
  9. From:         Ben Chi <BEC@ALBANY.BITNET>
  10. Subject:      Re: Need scientific math for OS/2 REXX
  11. In-Reply-To:  Message of Mon,
  12.               27 Jul 1992 00:18:27 GMT from <dlb5404@TAMSUN.TAMU.EDU>
  13. Lines: 44
  14.  
  15. On Mon, 27 Jul 1992 00:18:27 GMT Daryl Biberdorf said:
  16. >Has anyone written a REXX library for OS/2 that implements scientific
  17. >math functions (trigonometric, logarithms, etc.)?  I'm *really* needing
  18. >an exponentiation function that will let me specify a real (versus
  19. >whole) number for the power, for instance 2**0.93. . .
  20.  
  21. Some time ago I wrote a REXX program which contained algorithms for evalu-
  22. ating all the common functions.  Its help file says (in part):
  23.  
  24.   EVX  expression   evaluates any numeric (or, more generally,
  25.   any REXX) expression.  Examples:
  26.  
  27.   EVX 24*(35/2)-.5        returns 419.5
  28.   EVX max(3.5,3/2,17/3)   returns 5.6666667
  29.   EVX 3*sqrt(2.7)         returns 4.9295030
  30.   EVX reverse(abcxyz)     returns ZYXCBA
  31.   EVX date()              returns 19 Feb 1987  (for instance)
  32.  
  33.   The expression may contain certain mathematical functions if
  34.   required.  Among the standard REXX functions, the ones using
  35.   numeric arguments and returning a numeric value are:
  36.  
  37.         ABS(x), MAX(x,y,...,z), MIN(x,y,...,z), SIGN(x).
  38.  
  39.   Two utility functions are rad(x) and deg(x),  which  convert
  40.   degrees to radians and radians to degrees, respectively.
  41.  
  42.   Finally,  the  following  algebraic and transcendental func-
  43.   tions are provided:
  44.  
  45.     sqrt(x)     sin(x)      asin(x)     fctrl(x)
  46.     cbrt(x)     cos(x)      acos(x)     gamma(x)
  47.     ln(x)       tan(x)      atan(x)     lngamma(x)
  48.     exp(x)      cot(x)      acot(x)     erf(x)
  49.     sinh(x)     sec(x)      asec(x)     erfc(x)
  50.     cosh(x)     csc(x)      acsc(x)
  51.  
  52. This may bring you sufficiently close to your goal of evaluating 2**(.93)
  53. = exp(.93*ln(2)).  While written for CMS REXX, I can't see why it shouldn't
  54. work as well on other platforms.
  55.  
  56. TELL LISTSERV AT ALBANY GET EVX EXEC
  57. and have a look for yourself.
  58.                                              /b
  59.