Good way to hash a float vector?

后端 未结 7 869
刺人心
刺人心 2020-12-07 21:13

I am well aware of all the problems involved in comparing floats. This is exactly the reason for this question.
I\'m looking to create a fast hash table for values that

相关标签:
7条回答
  • 2020-12-07 21:46

    Some languages (C, Java 5) allow you to access the binary value of your floats. This way, you can extract the first N bits of the mantissa (ignoring the last few bits which cause the trouble during compare) and calculate the hash from that.

    0 讨论(0)
提交回复
热议问题