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