(ctx, x)
Determine whether *x* is "normal" in the sense of floating-point
        representation; that is, return *False* if *x* is zero, an
        infinity or NaN; otherwise return *True*. By extension, a
        complex number *x* is considered "normal" if its magnitude is
        normal::

            >>> from sympy.mpmath import *
            >>> isnormal(3)
            True
            >>> isnormal(0)
            False
            >>> isnormal(inf); isnormal(-inf); isnormal(nan)
            False
            False
            False
            >>> isnormal(0+0j)
            False
            >>> isnormal(0+3j)
            True
            >>> isnormal(mpc(2,nan))
            False
Determine whether *x* is "normal" in the sense of floating-point
        representation; that is, return *False* if *x* is zero, an
        infinity or NaN; otherwise return *True*. By extension, a
        complex number *x* is considered "normal" if its magnitude is
        normal::
Determine whether * x * is normal in the sense of floating - point representation ; that is return * False * if * x * is zero an infinity or NaN ; otherwise return * True * . By extension a complex number * x * is considered normal if its magnitude is normal ::
def isnormal(ctx, x):
        """
        Determine whether *x* is "normal" in the sense of floating-point
        representation; that is, return *False* if *x* is zero, an
        infinity or NaN; otherwise return *True*. By extension, a
        complex number *x* is considered "normal" if its magnitude is
        normal::

            >>> from sympy.mpmath import *
            >>> isnormal(3)
            True
            >>> isnormal(0)
            False
            >>> isnormal(inf); isnormal(-inf); isnormal(nan)
            False
            False
            False
            >>> isnormal(0+0j)
            False
            >>> isnormal(0+3j)
            True
            >>> isnormal(mpc(2,nan))
            False
        """
        if hasattr(x, "_mpf_"):
            return bool(x._mpf_[1])
        if hasattr(x, "_mpc_"):
            re, im = x._mpc_
            re_normal = bool(re[1])
            im_normal = bool(im[1])
            if re == fzero: return im_normal
            if im == fzero: return re_normal
            return re_normal and im_normal
        if isinstance(x, int_types) or isinstance(x, rational.mpq):
            return bool(x)
        x = ctx.convert(x)
        if hasattr(x, '_mpf_') or hasattr(x, '_mpc_'):
            return ctx.isnormal(x)
        raise TypeError("isnormal() needs a number as input")
def isnormal ( ctx , x ) : if hasattr ( x , "_mpf_" ) : return bool ( x . _mpf_ [ 1 ] ) if hasattr ( x , "_mpc_" ) : re , im = x . _mpc_ re_normal = bool ( re [ 1 ] ) im_normal = bool ( im [ 1 ] ) if re == fzero : return im_normal if im == fzero : return re_normal return re_normal and im_normal if isinstance ( x , int_types ) or isinstance ( x , rational . mpq ) : return bool ( x ) x = ctx . convert ( x ) if hasattr ( x , '_mpf_' ) or hasattr ( x , '_mpc_' ) : return ctx . isnormal ( x ) raise TypeError ( "isnormal() needs a number as input" )