### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Mathematical functions »

# numpy.log2

`numpy.``log2`(x, y=None)

  Return the base 2 logarithm.

  Parameters: | x : array_like Input array. y : array_like Optional output array with the same shape as x.
  Returns: | y : ndarray The logarithm to the base 2 of x elementwise. NaNs are returned where x is negative.

  See also

  `log`, `log1p`, `log10`

  Examples

      >>> np.log2([-1,2,4])
      array([ NaN,   1.,   2.])

### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Mathematical functions »