|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.util.tree.NumberArithmetic
public class NumberArithmetic
Provides many arithmetic and trigonometric functions that operate on
Numbers, performing any necessary implicit casting. An integer
number remains an integer unless the specific function requires
floating-point values. These methods favor Long and Double
representations for integer and floating-point values, respectively.
The arithmetic functions provided herein support optional function
protection, which is enabled by default. Function protection prevents
values like Inf and NaN from appearing due to invalid
inputs. For example, this protects against division-by-zero. To disable
function protection, set the property
org.moeaframework.util.tree.protected_functions = false in the file
global.properties. Inf and NaN values can still
occur with function protection enabled, so outputs should still be
validated.
| Method Summary | |
|---|---|
static Number |
abs(Number a)
Returns the absolute value of the number. |
static Number |
acos(Number a)
Returns the arc cosine of the number. |
static Number |
acosh(Number a)
Returns the hyperbolic arc cosine of the number. |
static Number |
add(Number a,
Number b)
Returns the value of adding the two numbers |
static Number |
asin(Number a)
Returns the arc sine of the number. |
static Number |
asinh(Number a)
Returns the hyperbolic arc sine of the number. |
static Number |
atan(Number a)
Returns the arc tangent of the number. |
static Number |
atanh(Number a)
Returns the hyperbolic arc tangent of the number. |
static Number |
ceil(Number a)
Returns the smallest integer value greater than or equal to the given number. |
static Number |
cos(Number a)
Returns the trigonometric cosine of the number. |
static Number |
cosh(Number a)
Returns the hyperbolic cosine of the number. |
static Number |
div(Number a,
Number b)
Returns the value of dividing the first number by the second. |
static boolean |
equals(Number a,
Number b)
Returns true if the two numbers are equal; false
otherwise. |
static Number |
exp(Number a)
Returns the value from taking Euler's number e to the power of the given number. |
static Number |
floor(Number a)
Returns the largest integer value less than or equal to the given number. |
static boolean |
greaterThan(Number a,
Number b)
Returns true if the first number is greater than the second;
false otherwise. |
static boolean |
greaterThanOrEqual(Number a,
Number b)
Returns true if the first number is greater than or equal to the
second; false otherwise. |
static boolean |
isFloatingPoint(Number a)
Returns true if the number is a floating-point value;
false otherwise. |
static boolean |
lessThan(Number a,
Number b)
Returns true if the first number is less than the second;
false otherwise. |
static boolean |
lessThanOrEqual(Number a,
Number b)
Returns true if the first number is less than or equal to the
second; false otherwise. |
static Number |
log(Number a)
Returns the natural logarithm of the number. |
static Number |
log10(Number a)
Returns the base-10 logarithm of the number. |
static Number |
max(Number a,
Number b)
Returns the maximum value of two numbers. |
static Number |
min(Number a,
Number b)
Returns the minimum value of two numbers. |
static Number |
mod(Number a,
Number b)
Returns the remainder from dividing the first number by the second. |
static Number |
mul(Number a,
Number b)
Returns the value of multiplying the two numbers. |
static Number |
pow(Number a,
Number b)
Returns the value of the first number to the power of the second. |
static Number |
round(Number a)
Returns the value of the number rounded to the nearest integer. |
static Number |
sign(Number a)
Returns the sign of the number. |
static Number |
sin(Number a)
Returns the trigonometric sine of the number. |
static Number |
sinh(Number a)
Returns the hyperbolic sine of the number. |
static Number |
sqrt(Number a)
Returns the square root of the number. |
static Number |
sub(Number a,
Number b)
Returns the value of subtracting the first from the second number. |
static Number |
tan(Number a)
Returns the trigonometric tangent of the number. |
static Number |
tanh(Number a)
Returns the hyperbolic tangent of the number. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean equals(Number a,
Number b)
true if the two numbers are equal; false
otherwise.
a - the first numberb - the second number
true if the two numbers are equal; false
otherwise
public static boolean lessThan(Number a,
Number b)
true if the first number is less than the second;
false otherwise.
a - the first numberb - the second number
true if the first number is less than the second;
false otherwise
public static boolean lessThanOrEqual(Number a,
Number b)
true if the first number is less than or equal to the
second; false otherwise.
a - the first numberb - the second number
true if the first number is less than or equal to the
second; false otherwise
public static boolean greaterThan(Number a,
Number b)
true if the first number is greater than the second;
false otherwise.
a - the first numberb - the second number
true if the first number is greater than the second;
false otherwise
public static boolean greaterThanOrEqual(Number a,
Number b)
true if the first number is greater than or equal to the
second; false otherwise.
a - the first numberb - the second number
true if the first number is greater than or equal to the
second; false otherwise
public static Number add(Number a,
Number b)
a - the first numberb - the second number
public static Number sqrt(Number a)
a - the number
Math.sqrt(double)
public static Number pow(Number a,
Number b)
a - the first numberb - the second number
Math.pow(double, double)
public static Number sub(Number a,
Number b)
a - the first numberb - the second number
public static Number mul(Number a,
Number b)
a - the first numberb - the second number
public static Number div(Number a,
Number b)
0 and function protection is enabled, this
function returns 1 regardless of the first argument's value.
a - the first numberb - the second number
public static Number mod(Number a,
Number b)
0 and function protection is enabled,
this function returns 0 regardless of the first argument's
value.
a - the first numberb - the second number
public static Number floor(Number a)
a - the number
Math.floor(double)public static Number ceil(Number a)
a - the number
Math.ceil(double)public static Number round(Number a)
a - the number
Math.round(double)public static Number abs(Number a)
a - the number
Math.abs(long),
Math.abs(double)public static Number log(Number a)
0.0.
a - the number
Math.log(double)public static Number log10(Number a)
0.0.
a - the number
Math.log10(double)public static Number exp(Number a)
a - the number
Math.exp(double)public static Number sin(Number a)
a - the number
Math.sin(double)public static Number cos(Number a)
a - the number
Math.cos(double)public static Number tan(Number a)
a - the number
Math.tan(double)public static Number asin(Number a)
a - the number
Math.asin(double)public static Number acos(Number a)
a - the number
Math.acos(double)public static Number atan(Number a)
a - the number
Math.atan(double)public static Number sinh(Number a)
a - the number
Math.sinh(double)public static Number cosh(Number a)
a - the number
Math.cosh(double)public static Number tanh(Number a)
a - the number
Math.tanh(double)public static Number asinh(Number a)
a - the number
FastMath.asinh(double)public static Number acosh(Number a)
a - the number
FastMath.acosh(double)public static Number atanh(Number a)
a - the number
FastMath.atanh(double)
public static Number max(Number a,
Number b)
a - the first numberb - the second number
Math.min(long, long),
Math.min(double, double)
public static Number min(Number a,
Number b)
a - the first numberb - the second number
Math.max(long, long),
Math.max(double, double)public static Number sign(Number a)
a - the number
Long.signum(long),
Math.signum(double)public static boolean isFloatingPoint(Number a)
true if the number is a floating-point value;
false otherwise.
a - the number
true if the number is a floating-point value;
false otherwise
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||