__hash__() public static method

public static __hash__ ( double d ) : int
d double
return int
示例#1
0
 public static int __hash__(Complex x)
 {
     if (x.Imaginary() == 0)
     {
         return(DoubleOps.__hash__(x.Real));
     }
     return(x.GetHashCode());
 }
示例#2
0
        public static int __hash__(Complex x)
        {
            if (x.Imaginary() == 0)
            {
                return(DoubleOps.__hash__(x.Real));
            }

            int hash = (DoubleOps.__hash__(x.Real) + SysModule.hash_info.imag * DoubleOps.__hash__(x.Imaginary)) % SysModule.hash_info.modulus;

            if (hash == -1)
            {
                hash = -2;
            }
            return(hash);
        }
示例#3
0
 public static int __hash__(float x)
 {
     return(DoubleOps.__hash__(((double)x)));
 }