

Log {base}                                   R Documentation

_L_o_g_a_r_i_t_h_m_s _a_n_d _E_x_p_o_n_e_n_t_i_a_l_s

_D_e_s_c_r_i_p_t_i_o_n_:

     `log' computes natural logarithms, `log10' computes
     common (i.e., base 10) logarithms, and `log2' computes
     binary (i.e., base 2) logarithms.  The general form
     `log(x, base)' computes logarithms with base `base'
     (`log10' and `log2' are only special cases).

     `exp' computes the exponential function.

_U_s_a_g_e_:

     log(x)
     log(x, base)
     log10(x)
     log2(x)
     exp(x)

_A_r_g_u_m_e_n_t_s_:

       x: a numeric or complex vector.

    base: positive number. The base with respect to which
          logarithms are computed.  Defaults to e=`exp(1)'.

_V_a_l_u_e_:

     A vector of the same length as `x' containing the
     transformed values.  `log(0)' gives `-Inf' (when avail-
     able).

_S_e_e _A_l_s_o_:

     `Trig', `Math', `Arithmetic'.

_E_x_a_m_p_l_e_s_:

     log(exp(3))
     all.equal(log(1:10), log(1:10, exp(1)))
     log10(30) == log(30, 10)
     log10(1e7)# = 7
     log2(2^pi) == 2^log2(pi)
     Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps
     Mod(1+exp(pi*1i)) < .Machine$double.eps

