1. Pre-preparation for the parentheses have such a rule:
--Only ( can be more than ) the number, at this time at the end of the line complement).
--Take the mold |...| cannot be nested. (There is no problem with Casio, because you will get two | Each time you press the modulo key, so you can define their size)
The calculator has the following functions:
--Basic subtraction: 1+2, 3/4
-Power: 3^2
--Take the mold: |-2|
--Imaginary I:2i
--take conjugate, amplitude angle: CJG (), Arg ()
--Trigonometric functions sin cos tan
--Multi-expression separation: 2+3:
--Variable and stored value: a+3, 2+3>a
--The answer automatically stored value: 3+2:ans-4 (==1)
Analysis method
We can divide a number into four parts:
--Positive sign part: [++--+-++-]
--Digital part: [215.2145]
--Variables and imaginary units part: [ANSANSABAIIIANSCJG (...) Arg (...)], which is multiplied here. For a "number", the second or third part must appear one time, otherwise it will be an error.
--Operator Part: *, ^,: ... When processing, it will be considered as an expression terminator, which can be easily judged by human addition, but the user cannot use the following: as the end.
Processing methods
Character by Word, dispatch field, these will not be discussed.
For an error, be sure to point out the wrong location. This preparation takes a variable to count.
Python Analog Casio Complex calculator "in construction"