Ejemplo n.º 1
0
            public UInt128 Visit(CosmosFloat32 cosmosFloat32, UInt128 seed)
            {
                UInt128 hash  = MurmurHash3.Hash128(CosmosNumberHasher.Float32HashSeed, seed);
                float   value = cosmosFloat32.GetValue();

                // Normalize 0.0f and -0.0f value
                // https://stackoverflow.com/questions/3139538/is-minus-zero-0-equivalent-to-zero-0-in-c-sharp
                if (value == 0.0f)
                {
                    value = 0;
                }

                hash = MurmurHash3.Hash128((UInt128)BitConverter.DoubleToInt64Bits(value), hash);
                return(hash);
            }
Ejemplo n.º 2
0
 public void Visit(CosmosFloat32 cosmosFloat32)
 {
     this.stringBuilder.AppendFormat("C_Float32({0:G7})", cosmosFloat32.GetValue());
 }