Copyright© 2008-2022 Sitevision AB, all rights reserved.
@Requireable(value="MathInstance") public interface MathInstance extends VelocityAccess.MathInstanceConstants
java.lang.Math
class that delegates all method calls to
the corresponding Math
method.
Note! Method documentations in this interface are only excerpts. For full documentation, see official java.lang.Math Javadoc
An instance of the Sitevision class implementing this interface can be obtained via InstanceCreatorUtil.getMathInstance()
.
See InstanceCreatorUtil
for how to obtain an instance of the InstanceCreatorUtil
interface.
Modifier and Type | Field and Description |
---|---|
static double |
E
The
double value that is closer than any other to
e, the base of the natural logarithms. |
static double |
PI
The
double value that is closer than any other to
pi, the ratio of the circumference of a circle to its diameter. |
Modifier and Type | Method and Description |
---|---|
double |
abs(double aValue)
Returns the absolute value of a
double value. |
float |
abs(float aValue)
Returns the absolute value of a
float value. |
int |
abs(int aValue)
Returns the absolute value of an
int value. |
long |
abs(long aValue)
Returns the absolute value of a
long value. |
double |
acos(double aValue)
Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.
|
int |
addExact(int x,
int y)
Returns the sum of its arguments,throwing an exception if the result overflows an
int . |
long |
addExact(long x,
long y)
Returns the sum of its arguments, throwing an exception if the result overflows a
long . |
double |
asin(double aValue)
Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2.
|
double |
atan(double aValue)
Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2.
|
double |
atan2(double y,
double x)
Returns the angle theta from the conversion of rectangular coordinates
(
x , y ) to polar coordinates (r, theta). |
double |
cbrt(double aValue)
Returns the cube root of a
double value. |
double |
ceil(double aValue)
Returns the smallest (closest to negative infinity)
double value that is greater than
or equal to the argument and is equal to a mathematical integer. |
double |
copySign(double aMagnitude,
double aSign)
Returns the first floating-point argument with the sign of the second floating-point argument.
|
float |
copySign(float aMagnitude,
float aSign)
Returns the first floating-point argument with the sign of the second floating-point argument.
|
double |
cos(double anAngleInRadians)
Returns the trigonometric cosine of an angle.
|
double |
cosh(double aValue)
Returns the hyperbolic cosine of a
double value. |
int |
decrementExact(int a)
Returns the argument decremented by one, throwing an exception if the result overflows an
int . |
long |
decrementExact(long a)
Returns the argument decremented by one, throwing an exception if the result overflows a
long . |
double |
exp(double anExponent)
Returns Euler's number e raised to the power of a
double value. |
double |
expm1(double x)
Returns ex -1.
|
double |
floor(double aValue)
Returns the largest (closest to positive infinity)
double value that is less than
or equal to the argument and is equal to a mathematical integer. |
int |
floorDiv(int x,
int y)
Returns the largest (closest to positive infinity)
int value that is less than or equal to the algebraic quotient. |
long |
floorDiv(long x,
long y)
Returns the largest (closest to positive infinity)
long value that is less than or equal to the algebraic quotient. |
int |
floorMod(int x,
int y)
Returns the floor modulus of the
int arguments. |
long |
floorMod(long x,
long y)
Returns the floor modulus of the
long arguments. |
int |
getExponent(double aValue)
Returns the unbiased exponent used in the representation of a
double . |
int |
getExponent(float aValue)
Returns the unbiased exponent used in the representation of a
float . |
double |
hypot(double x,
double y)
Returns sqrt(x2 +y2) without intermediate overflow or underflow.
|
double |
IEEEremainder(double aDividend,
double aDivisor)
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
|
int |
incrementExact(int a)
Returns the argument incremented by one, throwing an exception if the result overflows an
int . |
long |
incrementExact(long a)
Returns the argument incremented by one, throwing an exception if the result overflows a
long . |
double |
log(double aValue)
Returns the natural logarithm (base e) of a
double value. |
double |
log10(double aValue)
Returns the base 10 logarithm of a
double value. |
double |
log1p(double aValue)
Returns the natural logarithm of the sum of the argument and 1.
|
double |
max(double aValue,
double anAnotherValue)
Returns the greater of two
double values. |
float |
max(float aValue,
float anAnotherValue)
Returns the greater of two
float values. |
int |
max(int aValue,
int anAnotherValue)
Returns the greater of two
int values. |
long |
max(long aValue,
long anAnotherValue)
Returns the greater of two
long values. |
double |
min(double aValue,
double anAnotherValue)
Returns the smaller of two
double values. |
float |
min(float aValue,
float anAnotherValue)
Returns the smaller of two
float values. |
int |
min(int aValue,
int anAnotherValue)
Returns the smaller of two
int values. |
long |
min(long aValue,
long anAnotherValue)
Returns the smaller of two
long values. |
int |
multiplyExact(int x,
int y)
Returns the product of the arguments, throwing an exception if the result overflows an
int . |
long |
multiplyExact(long x,
long y)
Returns the product of the arguments, throwing an exception if the result overflows a
long . |
int |
negateExact(int a)
Returns the negation of the argument, throwing an exception if the result overflows an
int . |
long |
negateExact(long a)
Returns the negation of the argument, throwing an exception if the result overflows a
long . |
double |
nextAfter(double aStart,
double aDirection)
Returns the floating-point number adjacent to the first argument in the direction of the second argument.
|
float |
nextAfter(float aStart,
double aDirection)
Returns the floating-point number adjacent to the first argument in the direction of the second argument.
|
double |
nextDown(double d)
Returns the floating-point value adjacent to
d in the direction of negative infinity. |
float |
nextDown(float f)
Returns the floating-point value adjacent to
f in the direction of negative infinity. |
double |
nextUp(double aValue)
Returns the floating-point value adjacent to a
double in the direction of positive infinity. |
float |
nextUp(float aValue)
Returns the floating-point value adjacent to a
float in the direction of positive infinity. |
double |
pow(double aBase,
double anExponent)
Returns the value of the first argument raised to the power of the second argument.
|
double |
random()
Returns a
double value with a positive sign, greater
than or equal to 0.0 and less than 1.0 . |
double |
rint(double aValue)
Returns the
double value that is closest in value to the argument and is equal to
a mathematical integer. |
long |
round(double aValue)
Returns the closest
long to the argument. |
int |
round(float aValue)
Returns the closest
int to the argument. |
double |
scalb(double aDouble,
int aScaleFactor)
Return
aDouble × 2aScaleFactor rounded as if performed
by a single correctly rounded floating-point multiply to a member of the double value set. |
float |
scalb(float aFloat,
int aScaleFactor)
Return
aFloat × 2aScaleFactor rounded as if performed
by a single correctly rounded floating-point multiply to a member of the float value set. |
double |
signum(double aValue)
Returns the signum function of the argument.
|
float |
signum(float aValue)
Returns the signum function of the argument.
|
double |
sin(double anAngleInRadians)
Returns the trigonometric sine of an angle.
|
double |
sinh(double aValue)
Returns the hyperbolic sine of a
double value. |
double |
sqrt(double aValue)
Returns the correctly rounded positive square root of a
double value. |
int |
subtractExact(int x,
int y)
Returns the difference of the arguments, throwing an exception if the result overflows an
int . |
long |
subtractExact(long x,
long y)
Returns the difference of the arguments, throwing an exception if the result overflows a
long . |
double |
tan(double anAngleInRadians)
Returns the trigonometric tangent of an angle.
|
double |
tanh(double aValue)
Returns the hyperbolic tangent of a
double value. |
double |
toDegrees(double anAngleInRadians)
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
|
int |
toIntExact(long value)
Returns the value of the
long argument, throwing an exception if the value overflows an int . |
double |
toRadians(double anAngleInDegrees)
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
|
double |
ulp(double aValue)
Returns the size of an ulp of the argument.
|
float |
ulp(float aValue)
Returns the size of an ulp of the argument.
|
getE, getPI
static final double E
double
value that is closer than any other to
e, the base of the natural logarithms.static final double PI
double
value that is closer than any other to
pi, the ratio of the circumference of a circle to its diameter.double sin(double anAngleInRadians)
anAngleInRadians
- an angle, in radians.double cos(double anAngleInRadians)
anAngleInRadians
- an angle, in radians.double tan(double anAngleInRadians)
anAngleInRadians
- an angle, in radians.double asin(double aValue)
aValue
- the value whose arc sine is to be returned.double acos(double aValue)
aValue
- the value whose arc cosine is to be returned.double atan(double aValue)
aValue
- the value whose arc tangent is to be returned.double toRadians(double anAngleInDegrees)
anAngleInDegrees
- an angle, in degreesanAngleInDegrees
in radians.double toDegrees(double anAngleInRadians)
anAngleInRadians
- an angle, in radiansanAngleInRadians
in degrees.double exp(double anExponent)
double
value.anExponent
- the exponent to raise e to.anExponent
,
where e is the base of the natural logarithms.double log(double aValue)
double
value.aValue
- a valueaValue
, the natural logarithm of aValue
.double log10(double aValue)
double
value.aValue
- a valueaValue
.double sqrt(double aValue)
double
value.aValue
- a value.aValue
.
If the argument is NaN or less than zero, the result is NaN.double cbrt(double aValue)
double
value.aValue
- a value.aValue
.double IEEEremainder(double aDividend, double aDivisor)
aDividend
- the dividend.aDivisor
- the divisor.aDividend
is divided by aDivisor
.double ceil(double aValue)
double
value that is greater than
or equal to the argument and is equal to a mathematical integer.aValue
- a value.double floor(double aValue)
double
value that is less than
or equal to the argument and is equal to a mathematical integer.aValue
- a value.double rint(double aValue)
double
value that is closest in value to the argument and is equal to
a mathematical integer.aValue
- a value.aValue
that is equal to a mathematical integer.double atan2(double y, double x)
x
, y
) to polar coordinates (r, theta).y
- the ordinate coordinatex
- the abscissa coordinatedouble pow(double aBase, double anExponent)
aBase
- the base.anExponent
- the exponent.aBaseanExponent
.int round(float aValue)
int
to the argument.aValue
- a floating-point value to be rounded to an integer.int
value.long round(double aValue)
long
to the argument.aValue
- a floating-point value to be rounded to a long
.long
value.double random()
double
value with a positive sign, greater
than or equal to 0.0
and less than 1.0
.double
greater than or equal
to 0.0
and less than 1.0
.int abs(int aValue)
int
value.aValue
- the argument whose absolute value is to be determinedlong abs(long aValue)
long
value.aValue
- the argument whose absolute value is to be determinedfloat abs(float aValue)
float
value.aValue
- the argument whose absolute value is to be determineddouble abs(double aValue)
double
value.aValue
- the argument whose absolute value is to be determinedint max(int aValue, int anAnotherValue)
int
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.long max(long aValue, long anAnotherValue)
long
values.aValue
- an argument.anAnotherValue
- another argument.a
and anAnotherValue
.float max(float aValue, float anAnotherValue)
float
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.double max(double aValue, double anAnotherValue)
double
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.int min(int aValue, int anAnotherValue)
int
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.long min(long aValue, long anAnotherValue)
long
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.float min(float aValue, float anAnotherValue)
float
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.double min(double aValue, double anAnotherValue)
double
values.aValue
- an argument.anAnotherValue
- another argument.aValue
and anAnotherValue
.double ulp(double aValue)
aValue
- the floating-point value whose ulp is to be returnedfloat ulp(float aValue)
aValue
- the floating-point value whose ulp is to be returneddouble signum(double aValue)
aValue
- the floating-point value whose signum is to be returnedfloat signum(float aValue)
aValue
- the floating-point value whose signum is to be returneddouble sinh(double aValue)
double
value.aValue
- The number whose hyperbolic sine is to be returned.aValue
.double cosh(double aValue)
double
value.aValue
- The number whose hyperbolic cosine is to be returned.aValue
.double tanh(double aValue)
double
value.aValue
- The number whose hyperbolic tangent is to be returned.aValue
.double hypot(double x, double y)
x
- a valuey
- a valuedouble expm1(double x)
x
- the exponent to raise e to in the computation of
ex
-1.x
- 1.double log1p(double aValue)
aValue
- a valueaValue
+ 1), the natural log of aValue
+ 1double copySign(double aMagnitude, double aSign)
aMagnitude
- the parameter providing the magnitude of the resultaSign
- the parameter providing the sign of the resultaMagnitude
and the sign of aSign
.float copySign(float aMagnitude, float aSign)
aMagnitude
- the parameter providing the magnitude of the resultaSign
- the parameter providing the sign of the resultaMagnitude
and the sign of aSign
.int getExponent(float aValue)
float
.aValue
- a float valueint getExponent(double aValue)
double
.aValue
- a double valuedouble nextAfter(double aStart, double aDirection)
aStart
- starting floating-point valueaDirection
- value indicating which of aStart
's neighbors or aStart
should be returnedaStart
in the direction of aDirection
.float nextAfter(float aStart, double aDirection)
aStart
- starting floating-point valueaDirection
- value indicating which of aStart
's neighbors or aStart
should be returnedaStart
in the direction of aDirection
.double nextUp(double aValue)
double
in the direction of positive infinity.aValue
- starting floating-point valuefloat nextUp(float aValue)
float
in the direction of positive infinity.aValue
- starting floating-point valuedouble scalb(double aDouble, int aScaleFactor)
aDouble
× 2aScaleFactor
rounded as if performed
by a single correctly rounded floating-point multiply to a member of the double value set.aDouble
- number to be scaled by a power of two.aScaleFactor
- power of 2 used to scale aDouble
aDouble
× 2aScaleFactor
float scalb(float aFloat, int aScaleFactor)
aFloat
× 2aScaleFactor
rounded as if performed
by a single correctly rounded floating-point multiply to a member of the float value set.aFloat
- number to be scaled by a power of two.aScaleFactor
- power of 2 used to scale aFloat
aFloat
× 2aScaleFactor
int addExact(int x, int y)
int
.x
- the first valuey
- the second valueArithmeticException
- if the result overflows an intlong addExact(long x, long y)
long
.x
- the first valuey
- the second valueArithmeticException
- if the result overflows a longint subtractExact(int x, int y)
int
.x
- the first valuey
- the second value to subtract from the firstArithmeticException
- if the result overflows an intlong subtractExact(long x, long y)
long
.x
- the first valuey
- the second value to subtract from the firstArithmeticException
- if the result overflows a longint multiplyExact(int x, int y)
int
.x
- the first valuey
- the second valueArithmeticException
- if the result overflows an intlong multiplyExact(long x, long y)
long
.x
- the first valuey
- the second valueArithmeticException
- if the result overflows a longint incrementExact(int a)
int
.a
- the value to incrementArithmeticException
- if the result overflows an intlong incrementExact(long a)
long
.a
- the value to incrementArithmeticException
- if the result overflows a longint decrementExact(int a)
int
.a
- the value to decrementArithmeticException
- if the result overflows an intlong decrementExact(long a)
long
.a
- the value to decrementArithmeticException
- if the result overflows a longint negateExact(int a)
int
.a
- the value to negateArithmeticException
- if the result overflows an intlong negateExact(long a)
long
.a
- the value to negateArithmeticException
- if the result overflows a longint toIntExact(long value)
long
argument, throwing an exception if the value overflows an int
.value
- the long valueArithmeticException
- if the argument
overflows an intint floorDiv(int x, int y)
int
value that is less than or equal to the algebraic quotient.x
- the dividendy
- the divisorint
value that is less than or equal to the algebraic quotient.ArithmeticException
- if the divisor y
is zerofloorMod(int, int)
,
floor(double)
long floorDiv(long x, long y)
long
value that is less than or equal to the algebraic quotient.x
- the dividendy
- the divisorlong
value that is less than or equal to the algebraic quotient.ArithmeticException
- if the divisor y
is zerofloorMod(long, long)
,
floor(double)
int floorMod(int x, int y)
int
arguments.x
- the dividendy
- the divisorx - (floorDiv(x, y) * y)
ArithmeticException
- if the divisor y
is zerofloorDiv(int, int)
long floorMod(long x, long y)
long
arguments.x
- the dividendy
- the divisorx - (floorDiv(x, y) * y)
ArithmeticException
- if the divisor y
is zerofloorDiv(long, long)
double nextDown(double d)
d
in the direction of negative infinity.d
- starting floating-point valuefloat nextDown(float f)
f
in the direction of negative infinity.f
- starting floating-point valueSitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.