There is a problem with the hash function currently used for floats. It
multiplies by some number and casts the result to an UINT32. This will
lead to many floats having the same hash value 0. Especially bad case:

hash_values(random(Float.MAX))

Also from those results I would say that random is broken for floats. It
will always produce values lying within a few orders of magnitues in the
above case. There is many options for good hash functions for
floats/ints. Any preferences?

arne
  • float hashing Arne Goedeke
    • float hashing Mirar @ Pike developers forum
      • Re: float ha... Arne Goedeke
        • Re: floa... Mirar @ Pike developers forum
          • Re: ... Arne Goedeke
            • ... Mirar @ Pike developers forum
              • ... Arne Goedeke
                • ... Martin Stjernholm, Roxen IS @ Pike developers forum
                • ... Martin Stjernholm, Roxen IS @ Pike developers forum
                • ... Arne Goedeke
                • ... Martin Stjernholm, Roxen IS @ Pike developers forum

Reply via email to