Question

I'm developing an Android app that i get an String with the mathematical expression i have to calculate, i did it to convert the letters into the numbers i need, but what is the best way to evaluate this?

Nothing too complicated, the formulas are like those: ((A * 2 + B * 3 + C * 5) / 10) + D

EDIT: Just found that guy, very simple API, works like a charm http://code.google.com/p/symja/wiki/MathExpressionParser

Was it helpful?

Solution

You want some sort of math parser.

Fun to roll your own, or there are plenty of hits on google: https://www.google.co.uk/#hl=en&gs_nf=1&cp=16&gs_id=7&xhr=t&q=java+math+parser

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top