| java.lang.Object | |
| ↳ | java.lang.Math |
Class math provides various floating point support routines and some standard constants.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| double | E | The double value closest to e, the base of the natural logarithm. | |||||||||
| double | PI | The double value closest to pi, the ratio of a circle's circumference to its diameter. | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns the remainder of dividing the first argument by the second using
the IEEE 754 rules.
| |||||||||||
Returns the absolute value of the argument.
| |||||||||||
Returns the absolute value of the argument.
| |||||||||||
Returns the absolute value of the argument.
| |||||||||||
Returns the absolute value of the argument.
| |||||||||||
Returns the closest double approximation of the arc cosine of the
argument
| |||||||||||
Returns the closest double approximation of the arc sine of the argument
| |||||||||||
Returns the closest double approximation of the arc tangent of the
argument
| |||||||||||
Returns the closest double approximation of the arc tangent of the result
of dividing the first argument by the second argument.
| |||||||||||
Returns the closest double approximation of the cube root of the
argument.
| |||||||||||
Returns the double conversion of the most negative (i.e.
| |||||||||||
Returns the closest double approximation of the cosine of the argument
| |||||||||||
Returns the closest double approximation of the hyperbolic cosine of the
argument.
| |||||||||||
Returns the closest double approximation of the raising "e" to the power
of the argument
| |||||||||||
Returns the closest double approximation of ed - 1.
| |||||||||||
Returns the double conversion of the most positive (i.e.
| |||||||||||
Returns sqrt(x2+y2).
| |||||||||||
Returns the closest double approximation of the natural logarithm of the
argument
| |||||||||||
Returns the closest double approximation of the base 10 logarithm of the
argument
| |||||||||||
Returns the closest double approximation of the natural logarithm of the
sum of the argument and 1.
| |||||||||||
Returns the most positive (i.e.
| |||||||||||
Returns the most positive (i.e.
| |||||||||||
Returns the most positive (i.e.
| |||||||||||
Returns the most positive (i.e.
| |||||||||||
Returns the most negative (i.e.
| |||||||||||
Returns the most negative (i.e.
| |||||||||||
Returns the most negative (i.e.
| |||||||||||
Returns the most negative (i.e.
| |||||||||||
Returns the closest double approximation of the result of raising the
first argument to the power of the second.
| |||||||||||
Returns a pseudo-random number between 0.0 and 1.0.
| |||||||||||
Returns the double conversion of the result of rounding the argument to
an integer.
| |||||||||||
Returns the result of rounding the argument to an integer.
| |||||||||||
Returns the result of rounding the argument to an integer.
| |||||||||||
Returns the signum function of the argument.
| |||||||||||
Returns the signum function of the argument.
| |||||||||||
Returns the closest double approximation of the sine of the argument
| |||||||||||
Returns the closest double approximation of the hyperbolic sine of the
argument.
| |||||||||||
Returns the closest double approximation of the square root of the
argument
| |||||||||||
Returns the closest double approximation of the tangent of the argument
| |||||||||||
Returns the closest double approximation of the hyperbolic tangent of the
argument.
| |||||||||||
Returns the measure in degrees of the supplied radian angle
| |||||||||||
Returns the measure in radians of the supplied degree angle
| |||||||||||
Returns the argument's ulp.
| |||||||||||
Returns the argument's ulp.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
The double value closest to e, the base of the natural logarithm.
The double value closest to pi, the ratio of a circle's circumference to its diameter.
Returns the remainder of dividing the first argument by the second using the IEEE 754 rules.
| d1 | the numerator of the operation |
|---|---|
| d2 | the denominator of the operation |
Returns the absolute value of the argument.
| f | the value to be converted |
|---|
Returns the absolute value of the argument.
| l | the value to be converted |
|---|
Returns the absolute value of the argument.
| i | the value to be converted |
|---|
Returns the absolute value of the argument.
| d | the value to be converted |
|---|
Returns the closest double approximation of the arc cosine of the argument
| d | the value to compute acos of |
|---|
Returns the closest double approximation of the arc sine of the argument
| d | the value to compute asin of |
|---|
Returns the closest double approximation of the arc tangent of the argument
| d | the value to compute atan of |
|---|
Returns the closest double approximation of the arc tangent of the result of dividing the first argument by the second argument.
| d1 | the numerator of the value to compute atan of |
|---|---|
| d2 | the denominator of the value to compute atan of |
Returns the closest double approximation of the cube root of the argument. The final result should be within 1ulp of the real result.
| d | the value to compute cube root of |
|---|
Returns the double conversion of the most negative (i.e. closest to negative infinity) integer value which is greater than the argument.
| d | the value to be converted |
|---|
Returns the closest double approximation of the cosine of the argument
| d | the angle to compute the cosine of, in radians |
|---|
Returns the closest double approximation of the hyperbolic cosine of the argument. The final result should be within 2.5ulps of the real result.
| d | the value to compute hyperbolic cosine of |
|---|
Returns the closest double approximation of the raising "e" to the power of the argument
| d | the value to compute the exponential of |
|---|
Returns the closest double approximation of ed - 1. If the argument is very close to 0, it is much more accurate to use expm1(d)+1 than exp(d). The final result should be within 1 ulp of the real result. For any finite input, the result should be no less than -1.0. If the real result is within 0.5 ulp of -1, -1.0 should be answered.
| d | the value to compute the ed - 1 of |
|---|
Returns the double conversion of the most positive (i.e. closest to positive infinity) integer value which is less than the argument.
| d | the value to be converted |
|---|
Returns sqrt(x2+y2). The final result is without medium underflow or overflow. The final result should be within 1 ulp of the real result. If one parameter remains constant, the result should be semi-monotonic.
| x | a double number |
|---|---|
| y | a double number |
Returns the closest double approximation of the natural logarithm of the argument
| d | the value to compute the log of |
|---|
Returns the closest double approximation of the base 10 logarithm of the argument
| d | the value to compute the log10 of |
|---|
Returns the closest double approximation of the natural logarithm of the sum of the argument and 1. If the argument is very close to 0, it is much more accurate to use log1p(d) than log(1.0+d). The final result should be within 1 ulp of the real result and be semi-monotonic.
| d | the value to compute the ln(1+d) of |
|---|
Returns the most positive (i.e. closest to positive infinity) of the two arguments.
| d1 | the first argument to check |
|---|---|
| d2 | the second argument |
Returns the most positive (i.e. closest to positive infinity) of the two arguments.
| i1 | the first argument to check |
|---|---|
| i2 | the second argument |
Returns the most positive (i.e. closest to positive infinity) of the two arguments.
| f1 | the first argument to check |
|---|---|
| f2 | the second argument |
Returns the most positive (i.e. closest to positive infinity) of the two arguments.
| l1 | the first argument to check |
|---|---|
| l2 | the second argument |
Returns the most negative (i.e. closest to negative infinity) of the two arguments.
| d1 | the first argument to check |
|---|---|
| d2 | the second argument |
Returns the most negative (i.e. closest to negative infinity) of the two arguments.
| l1 | the first argument to check |
|---|---|
| l2 | the second argument |
Returns the most negative (i.e. closest to negative infinity) of the two arguments.
| f1 | the first argument to check |
|---|---|
| f2 | the second argument |
Returns the most negative (i.e. closest to negative infinity) of the two arguments.
| i1 | the first argument to check |
|---|---|
| i2 | the second argument |
Returns the closest double approximation of the result of raising the first argument to the power of the second.
| d1 | the base of the operation. |
|---|---|
| d2 | the exponent of the operation. |
Returns a pseudo-random number between 0.0 and 1.0.
Returns the double conversion of the result of rounding the argument to an integer.
| d | the value to be converted |
|---|
Returns the result of rounding the argument to an integer.
| d | the value to be converted |
|---|
Returns the result of rounding the argument to an integer.
| f | the value to be converted |
|---|
Returns the signum function of the argument. If the argument is less than zero, it returns -1.0. If greater than zero, 1.0 is returned. It returns zero if the argument is also zero.
| d | the value to compute signum function of |
|---|
Returns the signum function of the argument. If the argument is less than zero, it returns -1.0. If greater than zero, 1.0 is returned. It returns zero if the argument is also zero.
| f | the value to compute signum function of |
|---|
Returns the closest double approximation of the sine of the argument
| d | the angle to compute the sine of, in radians |
|---|
Returns the closest double approximation of the hyperbolic sine of the argument. The final result should be within 2.5ulps of the real result.
| d | the value to compute hyperbolic sine of |
|---|
Returns the closest double approximation of the square root of the argument
| d | the value to compute sqrt of |
|---|
Returns the closest double approximation of the tangent of the argument
| d | the angle to compute the tangent of, in radians |
|---|
Returns the closest double approximation of the hyperbolic tangent of the argument. The absolute value is always less than 1. The final result should be within 2.5ulps of the real result. If the real result is within 0.5ulp of 1 or -1, it should answer exactly +1 or -1.
| d | the value to compute hyperbolic tangent of |
|---|
Returns the measure in degrees of the supplied radian angle
| angrad | an angle in radians |
|---|
Returns the measure in radians of the supplied degree angle
| angdeg | an angle in degrees |
|---|
Returns the argument's ulp. The size of a ulp of a float value is the positive distance between this value and the float value next larger in magnitude. For non-NaN x, ulp(-x) == ulp(x).
| f | the floating-point value to compute ulp of |
|---|
Returns the argument's ulp. The size of a ulp of a double value is the positive distance between this value and the double value next larger in magnitude. For non-NaN x, ulp(-x) == ulp(x).
| d | the floating-point value to compute ulp of |
|---|