def logn(n, x):
x = _fix_real_lt_zero(x)<EOL>n = _fix_real_lt_zero(n)<EOL>return nx.log(x)/nx.log(n)<EOL>
Take log base n of x.

If `x` contains negative inputs, the answer is computed and returned in the
complex domain.

Parameters
----------
n : int
   The base in which the log is taken.
x : array_like
   The value(s) whose log base `n` is (are) required.

Returns
-------
out : ndarray or scalar
   The log base `n` of the `x` value(s). If `x` was a scalar, so is
   `out`, otherwise an array is returned.

Examples
--------
>>> np.set_printoptions(precision=4)

>>> np.lib.scimath.logn(2, [4, 8])
array([ 2.,  3.])
>>> np.lib.scimath.logn(2, [-4, -8, 8])
array([ 2.+4.5324j,  3.+4.5324j,  3.+0.j    ])