Package net.objecthunter.exp4j.extras
Class FunctionsMisc
java.lang.Object
net.objecthunter.exp4j.extras.FunctionsMisc
This class contains a small set of useful functions that don't really fit in
the other categories.
- Since:
- 0.6-riddler
- Author:
- Federico Vera <[email protected]>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionConverts from degrees to radians.static final FunctionEquality function.static final doubleThis is the threshold used to consider values equal, that is, if two valuesaandbare separated by less than this threshold they will be considered to be equal, it has a default value of 1.0E-12static final FunctionReturns the Greatest Common Denominator of two numbers.static final FunctionBranching function.static final FunctionRetrieves the value ofDouble.POSITIVE_INFINITY.static final FunctionTells if a number isDouble.NaN.static final FunctionReturns the Least Common Multiple of two numbers.static final FunctionReturns the largest (closest to positive infinity) of two numbers.static final FunctionReturns the smallest (closest to negative infinity) of two numbers.static final FunctionConverts from radians to degrees.static final FunctionRounds to the closest integer. -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctiongetFunction(String name) Get the function for a given name.static Function[]Array with all the available functions.
-
Field Details
-
EQUAL
Equality function.The test is performed using a threshold given by
Operator.BOOLEAN_THRESHOLD.This function has two argument
equal(a, b)where:a: First value to testb: Second value to test
- Since:
- 0.6-riddler
- See Also:
-
IF
Branching function.This function has three argument
if(exp, v_true, v_false)where:exp: Boolean expressionv_true: Value if truev_false: Value if false
-
INFINITY
Retrieves the value ofDouble.POSITIVE_INFINITY.- Since:
- 0.8-riddler
- See Also:
-
IS_NAN
Tells if a number isDouble.NaN.- Since:
- 0.8-riddler
- See Also:
-
MIN
Returns the smallest (closest to negative infinity) of two numbers.- Since:
- 0.8-riddler
- See Also:
-
MAX
Returns the largest (closest to positive infinity) of two numbers.- Since:
- 0.8-riddler
- See Also:
-
GCD
Returns the Greatest Common Denominator of two numbers.The numbers WILL be rounded using
Math.round(double)before the analysis.If the resulting value is out of the range of the
longtype, then anArithmeticExceptionis thrown.- Since:
- 0.8-riddler
- See Also:
-
LCM
Returns the Least Common Multiple of two numbers.The numbers WILL be rounded using
Math.round(double)before the analysis.If the resulting value is out of the range of the
longtype, then anArithmeticExceptionis thrown.- Since:
- 0.8-riddler
- See Also:
-
ROUND
Rounds to the closest integer.- Since:
- 0.8-riddler
- See Also:
-
DEG2RAD
Converts from degrees to radians.- Since:
- 0.9-riddler
- See Also:
-
RAD2DEG
Converts from radians to degrees.- Since:
- 0.9-riddler
- See Also:
-
EQUALITY_THRESHOLD
public static final double EQUALITY_THRESHOLDThis is the threshold used to consider values equal, that is, if two valuesaandbare separated by less than this threshold they will be considered to be equal, it has a default value of 1.0E-12- See Also:
-
-
Method Details
-
getFunctions
Array with all the available functions. -
getFunction
Get the function for a given name.
-