On 17.12.2014, at 18:17, Chris Muller asqueaker@gmail.com wrote:
Float>>#hashKey32 self == NegativeInfinity ifTrue: [ ^ 0 ]. self == Infinity ifTrue: [ ^ 4294967294 ]. self isNaN ifTrue: [ ^ 4294967295 ]. self == NegativeZero ifTrue: [ ^ 2147483650 ]. "Smallest to largest negative IEEE 32-bit floats range
from (2147483649 to: 4286578687), so invert that range." self negative ifTrue: [ ^ (4286578687 - self asIEEE32BitWord) + 1 ]. "We're positive. IEEE positives range from (0 to: 2139095039)." ^ self asIEEE32BitWord + 2147483651
Since I need _maximum_ speed, I do not wish the check for Infinites and NaN's, the special cases, to require a message send..
This is a Float method. You can use the NaN class variable directly.
- Bert -