commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frank asseg <frank.as...@congrace.de>
Subject Re: [lang] math expression parser
Date Wed, 05 Jan 2011 20:09:45 GMT
Hola Paul,

On 05.01.2011 20:51, Paul Libbrecht wrote:
> I don't see why langs would have this, especially since it generally involves variables,
scopes, objects, etc.
> Can you compare that to JEXL ?
In comparison to JEXL i was looking for a possiblity to pass a simple
math expression to an evaluator containing some simple functions from
java.lang.Math like Math.sin(double x). An example taking user input
like "2^log(2-3)" and evaluating the result at runtime in a java
application.
 I did try using the Scripting engine in Java but firing it up and
evaluating expressions in this way is quite slow. With an unwarmed
javascript engine it took 1sec for 800 evaluations, while the evaluation
using a java implementation was done in 8ms.
 I thought this was of interest for commons-lang because i looked in the
lang.math.* package if there was an expression evaluator there.

have fun!

-- 
*frank asseg*
softwareentwicklung
sebastian-kneipp-strasse 14a
79104 freiburg i. brsg.
tel.: ++49-761-88790001
fax.: ++49-761-88790002
mail: frank.asseg@congrace.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message