I think my question can also be asked as follows: can a single decimal value be represented in more than one way in a double-precision variable.
I have a hash table implementation, double-precision floating-point numbers will be keys, and I use a hash algorithm that builds a hash, iterate over each double byte (which is at least 64-bit on my system, so 8 bytes for the hash ) My problem is that if a single value, for example, "1.2345", can be represented in binary form in a double of more than 1 path, then this can lead to many possible hash values ββfor a single value.
I am not sure where to explore this possibility. If I were to guess, I would suggest that this is not possible, or that if it is possible, something normalizes it to ensure that the value always has the same idea in the given system. I am mainly looking for confirmation of this.
If a value can have multiple representations, then I will need to normalize the value before hashing it, and I will like suggestions on how to do this.
EDIT:
I learned a little more about floating point numbers. They are stored as a mantessa and an exhibitor. So my question is that a single floating point number can be represented by more than one combination of mantem and exponent.
source share