Hash function for floats

前端 未结 6 1577
野趣味
野趣味 2020-12-03 07:38

I\'m currently implementing a hash table in C++ and I\'m trying to make a hash function for floats...

I was going to treat floats as integers by padding the decimal

6条回答
  •  -上瘾入骨i
    2020-12-03 07:46

    You can use the std hash, it's not bad:

     std::size_t myHash = std::cout << std::hash{}(myFloat);
    

提交回复
热议问题