Skip to main content
Post Undeleted by Dr. belisarius
added 405 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456

ThisA few things are happening in there.

First, Infinity is howbeing replaced by DirectedInfinity[1] in order to perform the different Mathematica "inifinities" behave under a numerical comparison. In fact Infinity is just an abbreviation of DirectedInfinity[1]. You can see it by doing:

list = {Infinity,  ComplexInfinity,// DirectedInfinity[],FullForm
(* DirectedInfinity[1], DirectedInfinity[-1]};*)
Quiet@If[# <

Next, the comparison takes place. It's done in the same way Mathematica always does, like in:

h[1] 6/., True,_?(# False,< Undefined]6 &) /@-> list
0
(* {False,h[0] Undefined,*)

But in your case the head h is DirectedInfinity. So your result is

(* Undefined,DirectedInfinity[0] False,*)

Now, that is a non-oriented infinity, exactly the same as ComplexInfinity. Just try it:

DirectedInfinity[0]
(* True}ComplexInfinity *)

And that's it.

This is how the different Mathematica "inifinities" behave under a numerical comparison:

list = {Infinity,  ComplexInfinity, DirectedInfinity[], DirectedInfinity[1], DirectedInfinity[-1]};
Quiet@If[# < 6., True, False, Undefined] & /@ list

(* {False, Undefined, Undefined, False, True} *)

A few things are happening in there.

First, Infinity is being replaced by DirectedInfinity[1] in order to perform the comparison. In fact Infinity is just an abbreviation of DirectedInfinity[1]. You can see it by doing:

Infinity // FullForm
(* DirectedInfinity[1] *)

Next, the comparison takes place. It's done in the same way Mathematica always does, like in:

h[1] /. _?(# < 6 &) -> 0
(* h[0] *)

But in your case the head h is DirectedInfinity. So your result is

(* DirectedInfinity[0] *)

Now, that is a non-oriented infinity, exactly the same as ComplexInfinity. Just try it:

DirectedInfinity[0]
(* ComplexInfinity *)

And that's it.

Post Deleted by Dr. belisarius
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456

This is how the different Mathematica "inifinities" behave under a numerical comparison:

list = {Infinity,  ComplexInfinity, DirectedInfinity[], DirectedInfinity[1], DirectedInfinity[-1]};
Quiet@If[# < 6., True, False, Undefined] & /@ list

(* {False, Undefined, Undefined, False, True} *)