Algorithm for Calculator application

  • Calculators
  • Thread starter Aaron Angel
  • Start date
  • #1
I need an algorithm for developing a calculator application. When I googled , I got results that perform the ordinary push and pop operations . I need the complete algorithm that can be useful to code a calculator application in GUI.
 

Answers and Replies

  • #2
DavidSnider
Gold Member
502
143
What is the goal of your project?

You could just download a library that evaluates mathematical expressions (or use a language feature like 'eval') and then have your GUI build strings to feed it.

If you want to know how expressions are parsed you might want to look into lex and yacc
http://en.wikipedia.org/wiki/Lex_(software)
 
  • #3
I am trying to develop a simple GUI calculator in matlab. I am going to perform simple operations like +-*/ . thats it.
 
  • #4
DavidSnider
Gold Member
502
143
I don't know matlab very well, but I'm guessing you don't need to worry about the algorithm, just use their GUI library to build strings and then feed those strings into matlab's eval function.
 

Related Threads on Algorithm for Calculator application

Replies
7
Views
2K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
886
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
8
Views
6K
  • Last Post
Replies
5
Views
14K
  • Last Post
Replies
1
Views
2K
Replies
1
Views
6K
Replies
30
Views
20K
Top