2
Module of functions that are like ufuncs in acting on arrays and optionally
3
storing results in an output array.
5
__all__ = ['fix', 'isneginf', 'isposinf', 'log2']
7
import numpy.core.numeric as nx
8
from numpy.core.numeric import asarray, empty, isinf, signbit
9
import numpy.core.umath as umath
12
""" Round x to nearest integer towards zero.
26
def isposinf(x, y=None):
27
"""Return a boolean array y with y[i] True for x[i] = +Inf.
29
If y is an array, the result replaces the contents of y.
32
y = empty(x.shape, dtype=nx.bool_)
33
umath.logical_and(isinf(x), ~signbit(x), y)
36
def isneginf(x, y=None):
37
"""Return a boolean array y with y[i] True for x[i] = -Inf.
39
If y is an array, the result replaces the contents of y.
42
y = empty(x.shape, dtype=nx.bool_)
43
umath.logical_and(isinf(x), signbit(x), y)
48
"""Returns the base 2 logarithm of x
50
If y is an array, the result replaces the contents of y.