2 exp - exponential function
9 eps nonzero real, defaults to epsilon()
11 return real or complex
14 Approximate the exponential function of x by a multiple of epsilon,
15 the error having absolute value less than 0.75 * eps.
16 If n is a positive integer, exp(x, 10^-n) will usually be
17 correct to the n-th decimal place, which, for large positive x
18 will give many significant figures.
21 ; print exp(2, 1e-5), exp(2,1e-10), exp(2, 1e-15), exp(2, 1e-20)
22 7.38906 7.3890560989 7.38905609893065 7.38905609893065022723
24 ; print exp(30, 1e5), exp(30, 1), exp(30, 1e-10)
25 10686474600000 10686474581524 10686474581524.4621469905
27 ; print exp(-20, 1e-5), exp(-20, 1e-10), exp(-20, 1e-15), exp(-20, 1e-20)
28 0 .0000000021 .000000002061154 .00000000206115362244
30 ; print exp(1+2i, 1e-5), exp(1+2i, 1e-10)
31 -1.1312+2.47173i -1.1312043838+2.471726672i
37 NUMBER *qexp(NUMBER *x, NUMBER *eps)
38 COMPLEX *c_exp(COMPLEX *x, NUMBER *eps)
43 ## Copyright (C) 1999 Landon Curt Noll
45 ## Calc is open software; you can redistribute it and/or modify it under
46 ## the terms of the version 2.1 of the GNU Lesser General Public License
47 ## as published by the Free Software Foundation.
49 ## Calc is distributed in the hope that it will be useful, but WITHOUT
50 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
51 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
52 ## Public License for more details.
54 ## A copy of version 2.1 of the GNU Lesser General Public License is
55 ## distributed with calc under the filename COPYING-LGPL. You should have
56 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
57 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
59 ## @(#) $Revision: 30.1 $
60 ## @(#) $Id: exp,v 30.1 2007/03/16 11:10:42 chongo Exp $
61 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/exp,v $
63 ## Under source code control: 1995/10/11 04:41:26
64 ## File existed as early as: 1995
66 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
67 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/