Post Reply 
newRPL: The complexity of complex mode
08-19-2016, 03:44 PM
Post: #1
newRPL: The complexity of complex mode
For a while I've been stuck implementing "proper" support for special numbers in complex mode. Now I'm wondering if it's worth the effort, as the number of different cases is making things complicated to handle, and other systems don't seem to need this complication.
So here's what I did, open for debate:
  • NaN
  • There's 3 different infinities:
    1. Real +/- infinite
    2. Undirected complex infinity
    3. Directed infinity, expressed as a complex number in polar form, with infinite magnitude and a well defined angle.


The complexity comes from having to implement operations between all these types of entities.

Then there's arbitrary decisions to be made about when to return different types of infinities.

For example, a division by zero between 2 reals when complex mode is disabled should return +/- real infinity. However, when complex mode is active, any division by zero (be it a real or a complex divided by zero) should return complex undirected infinity.

Then, there's what to do with some special complex numbers as below, should they be allowed to exist?
(Inf,0) = Real +Inf
(-Inf,0) = Real -Inf but it's actually malformed, as directed infinity in complex mode has to be in polar more, should be (Inf ∡180°)
(Inf,3) = Same as real Infinity? the angle tends to ∡0° if you look at it in polar mode
(0,Inf) = Malformed, should be (Inf ∡90°)
(0,-Inf) = Malformed, should be (Inf ∡-90°)
(3,Inf) = (Inf ∡90°)??
(Inf,Inf) = Undirected infinity?

And... there's operating on all of them, detecting them, converting to polar, etc.

There's quite a few cases here:
http://functions.wolfram.com/Constants/C...owAll.html

Is all these necessary? Is there a simpler complex way?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
newRPL: The complexity of complex mode - Claudio L. - 08-19-2016 03:44 PM



User(s) browsing this thread: 1 Guest(s)