This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java formulas in xml format

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have mathematical formulas which will be used inside java code.

Is there a way or an API to express these formulas through XML and read it from code and execute it?

The reason for this is the formulas may change at any time.

Regards,
 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's one possible approach, using Java6 and its embedded Javascript script engine, to handle fairly complex math expressions without much DIY:

 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MathML is a standard way to represent mathematical formulas in XML.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15359
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, the purpose of MathML is more to specify mathematical formulas so that they can be rendered in mathematical form. It's not really meant to specify formulas so that you can fill in values and "execute" (calculate) the result of the formula.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic