[Numpy-discussion] Re: numarray equivalent to sign() function

Scott David Daniels Scott.Daniels at Acm.Org
Sat Jun 26 19:11:01 CDT 2004


Mike Zingale wrote:

> Is there a replacement?
def sign(x): return min(max(-1, math.frexp(x)[0]*2), 1)

- Scott David Daniels
Scott.Daniels at Acm.Org





More information about the Numpy-discussion mailing list