0

Possible Duplicate:
using eval in Java
Is there a java equivalent of the python eval function?

How can I evaluate complicated mathematical expressions (with trigonometric functions) in Java, given as a String such as the following (say given angles are in degrees):

3 + 8 - ( 8 + sin(30) + 5 - 3 * 2 + (8 - 5 * 6) ) * cosec(45)

Please suggest any production quality third party libraries if available, or suggest suitable algorithm / data structure if I have to do the boilerplate coding myself.

4

0 回答 0