Mantis - Squeak
Viewing Issue Advanced Details
6729 Kernel minor always 10-13-07 22:14 04-18-10 22:05
nicolas cellier  
closed 3.10  
none trunk  
0006729: -Infinity closeTo: Infinity

self deny: (Float infinity negated closeTo: Float infinity)

Though, considering a straight line as the limit of a circle when radius grows infinite, they might be closer than I think...
MethodFinder methodFor: {{Float infinity}. Float infinity.}.

will thus find #negated. Warf!
 FloatInfinityCloseTo-M6729-Test.1.cs [^] (1,147 bytes) 10-17-07 21:47
 FloatInfinityCloseTo-M6729-Patch.1.cs [^] (626 bytes) 10-17-07 22:13

nicolas cellier   
10-13-07 22:34   
Even (Float infinity closeTo: Float infinity) is arguable...
Knowing that (Float infinity - Float infinity) isNan, how can IEEE 754 let me compare them equal?
nicolas cellier   
10-17-07 22:12   
SHOULD this really be so:
    self assert: (Float infinity closeTo: Float infinity).

IEEE 754 states it should:
    self assert: Float infinity = Float infinity.

However, comparing inf is somewhat messy:
    (lim (x->inf) 2*x) = inf
    (lim (x->inf) x) = inf
    (lim (x->inf) 2*x-x) = inf
Hmm these inf are not even close...

IEEE 754 has the right answer and contradict itself with:
    self assert: (Float infinity - Float infinity) isNan.

So why consider them equal?
I would better understand:
    self deny: (Float infinity closeTo: Float infinity).
Like nan, infinity cannot compare. All we can assert is isInfinite, but not = Float infinity.
Until someone comes with a good rationale to contradict me.


Provided patch will
    assert: (Float infinity closeTo: Float infinity)

If we want to deny it, it is as easy as
    (self isInfinite or: [num isInfinite]) ifTrue: [^ false].

But changing IEEE 754 behaviour (Float infinity ~= Float infinity) accordingly is not that simple...
(I consider this a BAD rationale!)
12-17-07 16:46   
"fix begin"
Installer mantis bug: 6729 fix:'FloatInfinityCloseTo-M6729-Patch.1.cs'.
"fix test"
Installer mantis bug: 6729 fix:'FloatInfinityCloseTo-M6729-Test.1.cs'.
"fix end"

nicolas cellier   
07-14-09 07:07   
The patch I proposed here does not solve 0007368
Resolution is superseded by 0007368.

nicolas cellier   
07-14-09 07:41   
"fix begin"
Installer mantis ensureFix: 7368.
"fix test"
Installer mantis bug: 6729 fix:'FloatInfinityCloseTo-M6729-Test.1.cs'.
"fix end"
nicolas cellier   
08-24-09 20:10   
Fixed in [^]