[Matrix-SIG] More on NaN and bugs? : was [Matrix-SIG] NaN

Janko Hauser jhauser@ifm.uni-kiel.de
Thu, 8 Oct 1998 23:36:54 +0200 (CEST)


May I add these two functions to this thread?

def isnan(m):
    """
    Returns a condition array, which is true where m has a NaN value.
    """
    return Numeric.not_equal(m,m)

def isinf(m):
    """
    Returns a condition array, which is true where m has an Inf value.
    Does not look for sign of Inf.
    """
    n = isnan(m)
    return isnan(Numeric.where(n,0,m)*0.)


Is there some obvious case, which is not covered?

__Janko