src/runtime: improve float/complex hashing

This allows positive and negative zero to hash to the same value,
as required by Go.

This is not perfect, but the best I could do without
revamping all the hash funtions to take a seed.

Fixes #2356
This commit is contained in:
Damian Gryski
2021-12-07 19:03:18 -08:00
committed by Ayke
parent 9734f349a3
commit 1903cf23c9
3 changed files with 77 additions and 3 deletions
+4
View File
@@ -72,3 +72,7 @@ structMap[{"tau", 3.14}]: 0
structMap[{"tau", 6.28}]: 0
tested preallocated map
tested growing of a map
2
2
2
2