NewRPL: Complex Numbers in Cartesian Form r[x,y] , ...
|
03-16-2017, 10:11 PM
(This post was last modified: 03-16-2017 10:14 PM by Claudio L..)
Post: #2
|
|||
|
|||
RE: NewRPL: Complex Numbers in Cartesian Form
(03-16-2017 03:47 AM)compsystems Wrote: Hello, sorry for my bad English Complex numbers are already implemented, but if you mean having the complex numbers written like (a,b) within a symbolic, there's a whole lot of syntax issues that arise from the use of parenthesis to separate the ordered pairs. I started working on the modifications to the parser to allow this, but I never finished and got stuck with parsing problems, so it's still in the todo list. I'm not sure it's a good idea since it gets confused with a function call (there's a reason the 50g doesn't allow it), but perhaps we could have a function C(re,im) that constructs a complex number. Then the syntax would be consistent and algebraic rules can be added to operate with the arguments of these functions: C(a,b)+C(c,d)->C(a+c,b+d) and so on for all other operators. If this is OK, then the parser doesn't need to be touched, only the function C needs to be added. However, when working with algebraic expressions it's always best to use 'x+i*y' format. I'll have to think about this more in depth to see how the pieces would fit together. EDIT: I guess a flag could determine if you want a complex number in an expression to be decompiled as 'x+i*y' or 'C(x,y)'. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)