IsNegativeZero() static private method

static private IsNegativeZero ( double value ) : bool
value double
return bool
Exemplo n.º 1
0
        public static string __str__(CodeContext /*!*/ context, Complex x)
        {
            if (x.Real != 0)
            {
                if (x.Imaginary() < 0 || DoubleOps.IsNegativeZero(x.Imaginary()))
                {
                    return("(" + FormatComplexValue(context, x.Real) + FormatComplexValue(context, x.Imaginary()) + "j)");
                }
                else   /* x.Imaginary() is NaN or >= +0.0 */
                {
                    return("(" + FormatComplexValue(context, x.Real) + "+" + FormatComplexValue(context, x.Imaginary()) + "j)");
                }
            }

            return(FormatComplexValue(context, x.Imaginary()) + "j");
        }
Exemplo n.º 2
0
        public static string __str__(CodeContext /*!*/ context, Complex x)
        {
            string j = (double.IsInfinity(x.Imaginary()) || double.IsNaN(x.Imaginary())) ? "*j" : "j";

            if (x.Real != 0)
            {
                if (x.Imaginary() < 0 || DoubleOps.IsNegativeZero(x.Imaginary()))
                {
                    return("(" + FormatComplexValue(context, x.Real) + FormatComplexValue(context, x.Imaginary()) + j + ")");
                }
                else   /* x.Imaginary() is NaN or >= +0.0 */
                {
                    return("(" + FormatComplexValue(context, x.Real) + "+" + FormatComplexValue(context, x.Imaginary()) + j + ")");
                }
            }

            return(FormatComplexValue(context, x.Imaginary()) + j);
        }