Is there an equivalent to the expr
command which works for complex numbers (represented lists of two doubles)?
This library provides functions for complex number arithmetic, and this seems to be a useful utility to define the required cexpr
function, but it doesn't work well.
E.g. it doesn't handle properly the brackets.
ParseExpressions::ParseExpr { (1) + ((2) + (3)) } { }
returns
+ [+ 1 ((2)] (3))
while it should return
+ [+ 1 2] 3
Also ParseExpressions::ParseExpr { {1 2} + {3 4} } {}
returns
+ 1 2 3 4
while it should return
+ {1 2} {3 4}
So basically I am asking for a robust version of this utility.