请输入您要查询的百科知识:

 

词条 Exp4j
释义

  1. Features

  2. License terms

  3. Examples of usage

  4. See also

  5. References

{{Infobox software
| name = exp4j
| programming language = Java
| latest release version = 0.4.3
| latest release date = 2014-10-10
| license= Apache License 2.0
| genre = Math
| website = {{url|http://www.objecthunter.net/exp4j/}}
}}

exp4j is a small Java library for evaluation of mathematical expressions. 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.

Features

  • Variables can be used in expressions
  • exp4j comes with a set of common built-in functions
  • Users can create and use their own custom operators
  • Users can create and use their own custom functions

License terms

exp4j is released under the terms of the Apache License 2.0

Examples of usage

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();

See also

  • Shunting-yard algorithm – Explanation of the Shunting-yard algorithm by Edsger Dijkstra
  • Reverse Polish notation - Allows Stack based algorithms to evaluate expressions
  • Apache License 2.0 - Version 2 of the Apache Software License
  • mXparser - Mathematical Expressions Parser / Evaluator

References

1 : Java (programming language) libraries

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/10 6:36:40