String math equation to actual numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thiago777
    New Member
    • May 2007
    • 89

    String math equation to actual numbers

    Hi!

    I need to interpret a string which contains a mathematical expression and get from it a double value. For example:

    from the string "(2+2)^2" get the value 16 (as integer or double)

    I prefer to use an existant method rather than writting my own interpreter if possible. Any ideas?

    thanks!
  • thiago777
    New Member
    • May 2007
    • 89

    #2
    Originally posted by thiago777
    Hi!

    I need to interpret a string which contains a mathematical expression and get from it a double value. For example:

    from the string "(2+2)^2" get the value 16 (as integer or double)

    I prefer to use an existant method rather than writting my own interpreter if possible. Any ideas?

    thanks!
    There must be a something like available.. google calculator for example already does this anyway.. when we type 2+2 it returns 4.

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      Here is an article that may help:
      Digging Into CalcPad

      Comment

      Working...