Re: equality and null pointers



Lew <lew@xxxxxxxxxxxxxxxxxxxx> writes:

Why would one want NaN to equal NaN? Doesn't that violate the
fundamental meaning of NaN?

Apparently, at least when you want to use Doubles as hash table keys.
See
<http://java.sun.com/javase/6/docs/api/java/lang/Double.html#equals(java.lang.Object)>.

It also makes sense when you're, say, writing data marshaling and
unmarshaling code and need to test it.

--
Jaakko Kangasharju, Helsinki Institute for Information Technology
Want a Gmail account? Just email me.
.



Relevant Pages

  • Re: Suggestion for an AES Based Hash Function
    ... amateurs posting here seem to favour cyphers, I go for hash functions. ... Rather than trying to use a strong one-way compression function would ... I have used a fixed set of keys in two places. ... preferred to have the first round keys fixed and to start deriving ...
    (sci.crypt)
  • Suggestion for an AES Based Hash Function
    ... amateurs posting here seem to favour cyphers, I go for hash functions. ... Rather than trying to use a strong one-way compression function would ... The round function ... I have used a fixed set of keys in two places. ...
    (sci.crypt)
  • Re: sort unique
    ... given that a hash table is not ... IMO if the vendor's algorithm does something "obvious", ... function to eliminate keys that hash to the same bucket per some ... strings of random lengths, and two strings are ...
    (comp.lang.lisp)
  • Re: My First C# (warning - long post)
    ... defined as a COBOL structure of 8192 bytes (this is for ... Hashtables use two objects, one is a 'key' and the other a 'value'. ... but is for storing keys only. ... // Add some elements to the hash table. ...
    (comp.lang.cobol)
  • Re: Why are tuples immutable?
    ... If hash equals id, then the first of those cases fails. ... to key the dict. ... I need to know the order of the keys in that list. ... >keys being mutable objects, that they want to mutate those object while ...
    (comp.lang.python)