April's fools aside,<p>"m[NaN] = 1 always creates a new hash table element (since the key is unequal to any existing entry), reading m[NaN] never finds any data (same reason), and iterating over the hash table yields each of the inserted NaN entries."<p>This suggests to me an ADT that special-cases insert on the key: if it's not NaN, put it in a hash table, but if it is, tack it onto (say) a plain linked list. Lookup NaN fails, traversing the structure traverses both the hash table and linked list.<p>Might be a bit more code than a straight-up hash table, but definitely less weird than calling rand in the hash function. (To me.)