Programming a complex calculator

What knowledge do I need for programming a complex calculator?
Like I've already programed one with +,-,*,/ but now I want to add sqrt and such things... I don't want someone to show me how to do I just want to know what I need to know so I can create it by myself.
I recommend creating something like an HP-11 with reverse polish. Parsing incorrect operator order entry is harder than RPN.

If you put a gui on it, you would just have a button for sqrt etc, and invoke the built in c++ sqrt function.

if its command line, you have to figure out how to handle the data input. One way would be to just allow exponents ...

1+3^0.5 for example would be 1+ sqrt(3)


Do you plan to do the more complicated math using available libraries or will you write the code yourself?
> Like I've already programed one with +,-,*,/ but now I want to add sqrt and such things...
> I just want to know what I need to know so I can create it by myself.

This is all that you need to know for extending your calculator with more operations on complex numbers:
http://en.cppreference.com/w/cpp/numeric/complex
(assuming that the underlying floating point type used is float, double or long double)
Last edited on
Topic archived. No new replies allowed.