how to do an arithmetic factorization and calculation

Discussion in '.NET' started by inbaly, Jan 28, 2010.

  1. inbaly

    inbaly

    Joined:
    Dec 22, 2009
    Messages:
    7
    Hi,

    can anyone help me find an algorithm that recieves a string and calculate it's arithmetic value?

    for example:

    the method will recieve: "(4+(6*2))/(2+2)"
    and the result would be 4.

    No need to do a validation on the string, we assume it's correct.

    Thanks!
     
    inbaly, Jan 28, 2010
    #1
    1. Advertising

  2. inbaly

    inbaly

    Joined:
    Dec 22, 2009
    Messages:
    7
    I found the Reverse Polish Notation, that answerd my question.
    If anyone runs into the same issue, they can use the following links:
    en.wikipedia.org/wiki/Reverse_Polish_notation
    and :
    en.wikipedia.org/wiki/Shunting-yard_algorithm
     
    inbaly, Feb 2, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tan Thuan Seah
    Replies:
    4
    Views:
    3,020
    E. Robert Tisdale
    Oct 20, 2004
  2. JSH
    Replies:
    15
    Views:
    1,588
  3. n00m
    Replies:
    9
    Views:
    931
  4. inbaly
    Replies:
    1
    Views:
    382
    inbaly
    Feb 2, 2010
  5. Keira Wilson

    file I/O and arithmetic calculation

    Keira Wilson, May 22, 2013, in forum: Python
    Replies:
    2
    Views:
    138
    Carlos Nepomuceno
    May 23, 2013
Loading...

Share This Page