本文整理汇总了Java中org.nfunk.jep.function.Exp类的典型用法代码示例。如果您正苦于以下问题:Java Exp类的具体用法?Java Exp怎么用?Java Exp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Exp类属于org.nfunk.jep.function包,在下文中一共展示了Exp类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addStandardFunctions
import org.nfunk.jep.function.Exp; //导入依赖的package包/类
public void addStandardFunctions() {
if (ingrediant != null) {
ingrediant.addStandardFunctions();
} else
super.addStandardFunctions();
addFunction("eval", new Eval());
addFunction("Sum", new Sum(this));
addFunction("Product", new Product());
addFunction("Min", new Min());
addFunction("Max", new Max());
addFunction("MinArg", new MinArg());
addFunction("MaxArg", new MaxArg());
addFunction("Simpson", new Simpson());
addFunction("Trapezium", new Trapezium());
addFunction("toBase", new ToBase());
addFunction("toHex", new ToBase(16, "0x"));
addFunction("fromBase", new FromBase());
addFunction("fromHex", new FromBase(16, "0x"));
addFunction("exp", new Exp());
addFunction("Define", new Define(this));
try {
MacroFunction sec = new MacroFunction("sec", 1, "1/cos(x)", this);
addFunction("sec", sec);
MacroFunction cosec = new MacroFunction("cosec", 1, "1/sin(x)", this);
addFunction("cosec", cosec);
MacroFunction cot = new MacroFunction("cot", 1, "1/tan(x)", this);
addFunction("cot", cot);
} catch (ParseException e) {
System.err.println(e.getMessage());
}
}
示例2: addStandardFunctions
import org.nfunk.jep.function.Exp; //导入依赖的package包/类
/**
* Adds the standard functions to the parser. If this function is not called
* before parsing an expression, functions such as sin() or cos() would
* produce an "Unrecognized function..." error.
* In most cases, this method should be called immediately after the JEP
* object is created.
* @since 2.3.0 alpha added if and exp functions
* @since 2.3.0 beta 1 added str function
*/
public void addStandardFunctions() {
//add functions to Function Table
funTab.put("sin", new Sine());
funTab.put("cos", new Cosine());
funTab.put("tan", new Tangent());
funTab.put("asin", new ArcSine());
funTab.put("acos", new ArcCosine());
funTab.put("atan", new ArcTangent());
funTab.put("atan2", new ArcTangent2());
funTab.put("sinh", new SineH());
funTab.put("cosh", new CosineH());
funTab.put("tanh", new TanH());
funTab.put("asinh", new ArcSineH());
funTab.put("acosh", new ArcCosineH());
funTab.put("atanh", new ArcTanH());
funTab.put("log", new Logarithm());
funTab.put("ln", new NaturalLogarithm());
funTab.put("exp", new Exp());
funTab.put("pow", new Power());
funTab.put("sqrt", new SquareRoot());
funTab.put("abs", new Abs());
funTab.put("mod", new Modulus());
funTab.put("sum", new Sum());
funTab.put("rand", new org.nfunk.jep.function.Random());
// rjm additions
funTab.put("if", new If());
funTab.put("str", new Str());
// rjm 13/2/05
funTab.put("binom", new Binomial());
// rjm 26/1/07
funTab.put("round", new Round());
funTab.put("floor", new Floor());
funTab.put("ceil", new Ceil());
funTab.put("append", new Append());
funTab.put("split", new Split());
funTab.put("substring", new Substring());
funTab.put("indexof", new IndexOf());
funTab.put("newId", new NewId());
funTab.put("date", new Date());
funTab.put("isNull", new IsNull());
funTab.put("isNotNull", new IsNotNull());
}
示例3: addStandardFunctions
import org.nfunk.jep.function.Exp; //导入依赖的package包/类
/**
* Adds the standard functions to the parser. If this function is not called
* before parsing an expression, functions such as sin() or cos() would
* produce an "Unrecognized function..." error.
* In most cases, this method should be called immediately after the JEP
* object is created.
* @since 2.3.0 alpha added if and exp functions
* @since 2.3.0 beta 1 added str function
*/
public void addStandardFunctions() {
//add functions to Function Table
funTab.put("sin", new Sine());
funTab.put("cos", new Cosine());
funTab.put("tan", new Tangent());
funTab.put("asin", new ArcSine());
funTab.put("acos", new ArcCosine());
funTab.put("atan", new ArcTangent());
funTab.put("atan2", new ArcTangent2());
funTab.put("sinh", new SineH());
funTab.put("cosh", new CosineH());
funTab.put("tanh", new TanH());
funTab.put("asinh", new ArcSineH());
funTab.put("acosh", new ArcCosineH());
funTab.put("atanh", new ArcTanH());
funTab.put("log", new Logarithm());
funTab.put("ln", new NaturalLogarithm());
funTab.put("exp", new Exp());
funTab.put("pow", new Power());
funTab.put("sqrt", new SquareRoot());
funTab.put("abs", new Abs());
funTab.put("mod", new Modulus());
funTab.put("sum", new Sum());
funTab.put("rand", new org.nfunk.jep.function.Random());
// rjm additions
funTab.put("if", new If());
funTab.put("str", new Str());
// rjm 13/2/05
funTab.put("binom", new Binomial());
// rjm 26/1/07
funTab.put("round", new Round());
funTab.put("floor", new Floor());
funTab.put("ceil", new Ceil());
funTab.put("append", new Append());
funTab.put("split", new Split());
funTab.put("substring", new Substring());
funTab.put("indexof", new IndexOf());
funTab.put("startswith", new StartsWith());
funTab.put("length", new Length());
funTab.put("cast", new Cast());
funTab.put("newId", new NewId());
funTab.put("date", new Date());
funTab.put("isNull", new IsNull());
funTab.put("isNotNull", new IsNotNull());
}