Notes 

(0010971)

tween

081007 15:38


This seems to have automatically assigned itself to Ken.
I don't know why. 


(0010972)

tween

081007 17:48


here are some other Number examples...
(1/2) = 0.5 > true
(1/2) hash = 0.5 hash > false
10s0 = 10 > true
10s0 hash = 10 hash > false 


(0010973)

KenCausey

081007 19:40


It was assigned to me because you failed to choose a category. 


(0010974)

KenCausey

081007 19:41




(0010975)

tween

081007 20:15




(0011120)

nicolas cellier

091207 20:46




(0012891)

nicolas cellier

010409 22:06


I like the proposed fix:
self fractionPart = 0.0 ifTrue:[^self truncated hash].
It does not work because Float infinity will raise an Error, but with help of 0006983 :
(self isFinite and: [self fractionPart = 0.0]) ifTrue:[^self truncated hash].
That does not spoil efficiency to much, except for large Floats, because they all have fractionPart = 0.0 and will trigger slow LargeInteger algorithms...
Is this a problem ?
I bet no because huge numbers are very rare...
Float allInstances size. "5107"
Float allInstances count: [:f  f isFinite and: [f truncated class ~= SmallInteger]]. "33"
Then, for fraction we'd better change hash to fit Float like this:
 tmp 
tmp := self asFloat.
tmp isFinite ifTrue: [^tmp hash].
^numerator hash bitXor: denominator hash
And if equality is based on exactness  see 0003374
 tmp 
denominator isPowerOfTwo ifTrue: [
"If denominator is not a power of two, I cannot be exactly equal to a Float"
tmp := self asFloat.
tmp isFinite ifTrue: [^tmp hash]].
^numerator hash bitXor: denominator hash
See 0003374 for changeSet 


(0012896)

nicolas cellier

010409 22:43


"fix begin"
Installer mantis ensureFix: 3374.
"fix test"
"fix end" 


(0013511)

nicolas cellier

021310 04:21


