__hash__() public static method

public static __hash__ ( double d ) : int
d double
return int
Beispiel #1
0
 public static int __hash__(Complex x)
 {
     if (x.Imaginary() == 0)
     {
         return(DoubleOps.__hash__(x.Real));
     }
     return(x.GetHashCode());
 }
Beispiel #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);
        }
Beispiel #3
0
 public static int __hash__(float x)
 {
     return(DoubleOps.__hash__(((double)x)));
 }