1. Re: EUPHORIA Digest - 28 Jul 1997 to 29 Jul 1997
- Posted by Jeff Zeitlin <jeff.zeitlin at EARTH.EXECNET.COM> Jul 30, 1997
- 586 views
- Last edited Jul 31, 1997
On Wed, 30 Jul 1997 00:00:08 -0500, Robert Craig wrote: >A few days ago Jeff Zeitlin wrote: >> There's a log function that returns the natural (base e) >> logarithm of a number, but there's no inverse function for it - >> i.e., there's no function that, when passed the value 1, will >> return the value of e. >> Yes, I know I can approximate it with 2.718281828459045, but... > >In some languages this function is called "exp". > >constant e=3D2.718281828459045 >function exp(object x) >-- returns e to the x (inverse of Euphoria log function) >-- x can be an atom or a sequence > return power(e, x) >end function Well, yes, I had gotten that far, and I suspect that my approximation will be more than accurate enough for ordinary use - the point I was indirectly making was that exp() is usually a built-in, and for all I know, it may _compute_ exp(1) rather than having it hardcoded in there as a constant. --=20 Jeff Zeitlin jeff.zeitlin at earth.execnet.com