The logarithmic family of functions (log
in its
various forms and exp
) use e as their foundation.
log | [Generic] |
Returns the exponent of a number
Synopsis
log (x, #key base) => (y)
Parameters
x An instance of <real>
.base:
An instance of <real>
. The number to which the exponent is applied to get x. The default is$double-e
Return Values
y An instance of <float>
.
Description
The
log
function scales large numbers, so that (e.g.) data points with a very large spread can be viewed together.log
assumes$double-e
as the base, but you may change that by supplying a different value. For example,log(100000, base: 10) => 5.0
exp | [Generic] |
Returns the e raised to a number
Synopsis
exp (x) => (y)
Parameters
x An instance of <real>
.
Return Values
y An instance of <float>
.
Description
exp
returns e raised to the number supplied. You may be wondering what purpose this function serves, given $double-e and\^
. Actually,exp
is a favorite function of mine, because it is used in the compounding interest formula, which is: T = Pert (The resulting Total money is Principal multiplied by e to the rt power (rate times time)). So, 10000 USD will be over 33000 USD if held for twelve years in an account earning 10 percent, as shown by the result of:10000 * exp(12 * 0.1)How many years will it take to make 1000000 USD if you start investing 10000 USD at 21 percent and add 500 USD per month?