newRPL: [UPDATED April 27-2017] Firmware for testing available for download
|
06-03-2016, 02:17 PM
Post: #284
|
|||
|
|||
RE: newRPL: [UPDATED May-06-16] Firmware for testing available for download
(06-03-2016 08:16 AM)JoJo1973 Wrote:(06-03-2016 02:21 AM)Claudio L. Wrote: It could work, though I haven't thought about it in depth. So a complex infinity would be shown on the stack as (∞,∞)? Or perhaps it should be (∞, NaN), in other words: infinite magnitude, but unknown direction. Or perhaps it should be a polar complex? (∞, ∡0.5r). So much food for thought that I'm going to choke! Let's see... If infinity is an object, what would the math library return when trying to divide 1 by 0 (which are reals)? Right now it simply marks the result with an infinity flag, because the only thing the decimal library can return is a real number. Object infinity would have to be handled 100% by higher level code (RPL library) as opposed to the decimal math library, including all special cases that could cause an infinity result, like TAN(∡90°). Right now in this example, the TAN function returns a real infinity, but the TAN code itself doesn't know anything about objects yet, it only deals with real numbers. So having a separate object might not help the developer of newRPL libraries that much, as every new command would need to handle the various new special objects. I think a simple way to represent it would be: ∞ (with or without the sign) = real infinity. (∞, ∡0.3r) = Complex infinity (directed) Since polar numbers stay polar in newRPL, Infinities don't need to be represented in cartesian form. However, this leaves one question: How to represent complex infinity in symbolic form? The complex form (x,y) is not allowed in a symbolic expression (though right now due to bad handling of complex numbers, adding a complex to a symbolic actually displays it in (x,y) form, but that shouldn't be allowed). I think '(x+i*y)*∞' is the only way to properly represent it (a complex number times real infinite magnitude), so we could say that directed infinity is doable. What about undirected infinity? I think there's no other way but to create a special symbol. Doesn't have to be a special object, though. An undirected infinity can come out as a result of a divide by zero, so technically the decimal library should output an undirected complex infinity rather than a real infinity. Thinking out loud, there's 2 flags on a real number: NAN and INF. What if we designate complex undirected infinity to a number that has BOTH flags up? It makes sense that it's infinity, but also undefined since it's direction in the complex plane is unknown. It could be displayed with a special symbol, like ∞̅ which for some reason doesn't look good on this forum (Unicode Infinity with combining overline). Yes, you could argue that doesn't make sense for complex infinity to be a real number... but it makes sense for a decimal library to be able to output complex infinity as a result of a real operation. So in the end: ∞ (with or without the sign) = real infinity. (∞, ∡0.3r) = Complex infinity (directed) ∞̅ = Undirected complex infinity (a real number w/some special flags). This should be able to accomplish most of what you discussed without fundamentally changing existing code. Undirected infinity should not be allowed inside a complex number though: (∞̅,0), (0,∞̅), (∞̅,∞̅) should be invalid. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)