Final

java.lang
Class StrictMath

java.lang.Object
  extended by java.lang.StrictMath

public final class StrictMath
extends Object

Class StrictMath provides various numeric operations using the standards set by the known "Freely Distributable Math Library" (fdlibm). The standard is set by the January 4th, 1995 version of the library.


Field Summary
static double E
          Standard math constant
static double PI
          Standard math constant
 
Method Summary
static double abs(double d)
          Answers the absolute value of the argument.
static float abs(float f)
          Answers the absolute value of the argument.
static int abs(int i)
          Answers the absolute value of the argument.
static long abs(long l)
          Answers the absolute value of the argument.
static double acos(double d)
          Answers the closest double approximation of the arc cosine of the argument
static double asin(double d)
          Answers the closest double approximation of the arc sine of the argument
static double atan(double d)
          Answers the closest double approximation of the arc tangent of the argument
static double atan2(double d1, double d2)
          Answers the closest double approximation of the arc tangent of the result of dividing the first argument by the second argument.
static double ceil(double d)
          Answers the double conversion of the most negative (i.e.
static double cos(double d)
          Answers the closest double approximation of the cosine of the argument
static double exp(double d)
          Answers the closest double approximation of the raising "e" to the power of the argument
static double floor(double d)
          Answers the double conversion of the most positive (i.e.
static double IEEEremainder(double d1, double d2)
          Answers the remainder of dividing the first argument by the second using the IEEE 754 rules.
static double log(double d)
          Answers the closest double approximation of the natural logarithm of the argument
static double max(double d1, double d2)
          Answers the most positive (i.e. closest to positive infinity) of the two arguments.
static float max(float f1, float f2)
          Answers the most positive (i.e. closest to positive infinity) of the two arguments.
static int max(int i1, int i2)
          Answers the most positive (i.e. closest to positive infinity) of the two arguments.
static long max(long l1, long l2)
          Answers the most positive (i.e. closest to positive infinity) of the two arguments.
static double min(double d1, double d2)
          Answers the most negative (i.e. closest to negative infinity) of the two arguments.
static float min(float f1, float f2)
          Answers the most negative (i.e. closest to negative infinity) of the two arguments.
static int min(int i1, int i2)
          Answers the most negative (i.e. closest to negative infinity) of the two arguments.
static long min(long l1, long l2)
          Answers the most negative (i.e. closest to negative infinity) of the two arguments.
static double pow(double d1, double d2)
          Answers the closest double approximation of the result of raising the first argument to the power of the second.
static double random()
          Returns a pseudo-random number between 0.0 and 1.0.
static double rint(double d)
          Answers the double conversion of the result of rounding the argument to an integer.
static long round(double d)
          Answers the result of rounding the argument to an integer.
static int round(float f)
          Answers the result of rounding the argument to an integer.
static double sin(double d)
          Answers the closest double approximation of the sine of the argument
static double sqrt(double d)
          Answers the closest double approximation of the square root of the argument
static double tan(double d)
          Answers the closest double approximation of the tangent of the argument
static double toDegrees(double angrad)
          Returns the measure in degrees of the supplied radian angle
static double toRadians(double angdeg)
          Returns the measure in radians of the supplied degree angle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E

public static final double E
Standard math constant

See Also:
Constant Field Values

PI

public static final double PI
Standard math constant

See Also:
Constant Field Values
Method Detail

abs

public static double abs(double d)
Answers the absolute value of the argument.

Parameters:
d - the value to be converted
Returns:
the argument if it is positive, otherwise the negation of the argument.

abs

public static float abs(float f)
Answers the absolute value of the argument.

Parameters:
f - the value to be converted
Returns:
the argument if it is positive, otherwise the negation of the argument.

abs

public static int abs(int i)
Answers the absolute value of the argument.

Parameters:
i - the value to be converted
Returns:
the argument if it is positive, otherwise the negation of the argument.

abs

public static long abs(long l)
Answers the absolute value of the argument.

Parameters:
l - the value to be converted
Returns:
the argument if it is positive, otherwise the negation of the argument.

acos

public static double acos(double d)
Answers the closest double approximation of the arc cosine of the argument

Parameters:
d - the value to compute acos of
Returns:
the arc cosine of the argument.

asin

public static double asin(double d)
Answers the closest double approximation of the arc sine of the argument

Parameters:
d - the value to compute asin of
Returns:
the arc sine of the argument.

atan

public static double atan(double d)
Answers the closest double approximation of the arc tangent of the argument

Parameters:
d - the value to compute atan of
Returns:
the arc tangent of the argument.

atan2

public static double atan2(double d1,
                           double d2)
Answers the closest double approximation of the arc tangent of the result of dividing the first argument by the second argument.

Parameters:
d1 - the numerator of the value to compute atan of
d2 - the denominator of the value to compute atan of
Returns:
the arc tangent of d1/d2.

ceil

public static double ceil(double d)
Answers the double conversion of the most negative (i.e. closest to negative infinity) integer value which is greater than the argument.

Parameters:
d - the value to be converted
Returns:
the ceiling of the argument.

cos

public static double cos(double d)
Answers the closest double approximation of the cosine of the argument

Parameters:
d - the value to compute cos of
Returns:
the cosine of the argument.

exp

public static double exp(double d)
Answers the closest double approximation of the raising "e" to the power of the argument

Parameters:
d - the value to compute the exponential of
Returns:
the exponential of the argument.

floor

public static double floor(double d)
Answers the double conversion of the most positive (i.e. closest to positive infinity) integer value which is less than the argument.

Parameters:
d - the value to be converted
Returns:
the ceiling of the argument.

IEEEremainder

public static double IEEEremainder(double d1,
                                   double d2)
Answers the remainder of dividing the first argument by the second using the IEEE 754 rules.

Parameters:
d1 - the numerator of the operation
d2 - the denominator of the operation
Returns:
the result of d1/d2.

log

public static double log(double d)
Answers the closest double approximation of the natural logarithm of the argument

Parameters:
d - the value to compute the log of
Returns:
the natural logarithm of the argument.

max

public static double max(double d1,
                         double d2)
Answers the most positive (i.e. closest to positive infinity) of the two arguments.

Parameters:
d1 - the first argument to check
d2 - the second argument
Returns:
the larger of d1 and d2.

max

public static float max(float f1,
                        float f2)
Answers the most positive (i.e. closest to positive infinity) of the two arguments.

Parameters:
f1 - the first argument to check
f2 - the second argument
Returns:
the larger of f1 and f2.

max

public static int max(int i1,
                      int i2)
Answers the most positive (i.e. closest to positive infinity) of the two arguments.

Parameters:
i1 - the first argument to check
i2 - the second argument
Returns:
the larger of i1 and i2.

max

public static long max(long l1,
                       long l2)
Answers the most positive (i.e. closest to positive infinity) of the two arguments.

Parameters:
l1 - the first argument to check
l2 - the second argument
Returns:
the larger of l1 and l2.

min

public static double min(double d1,
                         double d2)
Answers the most negative (i.e. closest to negative infinity) of the two arguments.

Parameters:
d1 - the first argument to check
d2 - the second argument
Returns:
the smaller of d1 and d2.

min

public static float min(float f1,
                        float f2)
Answers the most negative (i.e. closest to negative infinity) of the two arguments.

Parameters:
f1 - the first argument to check
f2 - the second argument
Returns:
the smaller of f1 and f2.

min

public static int min(int i1,
                      int i2)
Answers the most negative (i.e. closest to negative infinity) of the two arguments.

Parameters:
i1 - the first argument to check
i2 - the second argument
Returns:
the smaller of i1 and i2.

min

public static long min(long l1,
                       long l2)
Answers the most negative (i.e. closest to negative infinity) of the two arguments.

Parameters:
l1 - the first argument to check
l2 - the second argument
Returns:
the smaller of l1 and l2.

pow

public static double pow(double d1,
                         double d2)
Answers the closest double approximation of the result of raising the first argument to the power of the second.

Parameters:
d1 - the base of the operation.
d2 - the exponent of the operation.
Returns:
d1 to the power of d2

random

public static double random()
Returns a pseudo-random number between 0.0 and 1.0.

Returns:
a pseudo-random number

rint

public static double rint(double d)
Answers the double conversion of the result of rounding the argument to an integer.

Parameters:
d - the value to be converted
Returns:
the closest integer to the argument (as a double).

round

public static long round(double d)
Answers the result of rounding the argument to an integer.

Parameters:
d - the value to be converted
Returns:
the closest integer to the argument.

round

public static int round(float f)
Answers the result of rounding the argument to an integer.

Parameters:
f - the value to be converted
Returns:
the closest integer to the argument.

sin

public static double sin(double d)
Answers the closest double approximation of the sine of the argument

Parameters:
d - the value to compute sin of
Returns:
the sine of the argument.

sqrt

public static double sqrt(double d)
Answers the closest double approximation of the square root of the argument

Parameters:
d - the value to compute sqrt of
Returns:
the square root of the argument.

tan

public static double tan(double d)
Answers the closest double approximation of the tangent of the argument

Parameters:
d - the value to compute tan of
Returns:
the tangent of the argument.

toDegrees

public static double toDegrees(double angrad)
Returns the measure in degrees of the supplied radian angle

Parameters:
angrad - an angle in radians
Returns:
the degree measure of the angle.

toRadians

public static double toRadians(double angdeg)
Returns the measure in radians of the supplied degree angle

Parameters:
angdeg - an angle in degrees
Returns:
the radian measure of the angle.

Final

Licensed Materials - Property of IBM
© Copyright IBM Corp. 2006, 2007 All Rights Reserved.