exp4j is a small Java library for evaluation of mathematical expressions.[1] It implements Dijkstra's Shunting-yard algorithm to translate expressions f
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
| exp4j | |
|---|---|
| Stable release | 0.4.3
/ 2014-10-10 |
| Written in | Java |
| Type | Math |
| License | Apache License 2.0 |
| Website | www |
| Repository | |
exp4j is a small Java library for evaluation of mathematical expressions.[1] It implements Dijkstra's Shunting-yard algorithm to translate expressions from infix notation to Reverse Polish notation and calculates the result using a simple Stack algorithm.
exp4j is released under the terms of the Apache License 2.0
Calculating the result of can be done in the following way:
Expression e = new ExpressionBuilder("3 * (sin(pi) - 2 )/ e")
.variables("pi", "e")
.build()
.setVariable("pi", Math.PI)
.setVariable("e", Math.E);
double result = e.evaluate();
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.