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); }
public void Visit(CosmosFloat32 cosmosFloat32) { this.stringBuilder.AppendFormat("C_Float32({0:G7})", cosmosFloat32.GetValue()); }