aicas logoJamaica 3.2 release 62

java.lang
Class Math

java.lang.Object
  extended by java.lang.Math

public class Math
extends Object

Math provides basic mathematical functions.

Since:
1.0

Field Summary
static double E
          value of "E"
static double PI
          value of "PI"
 
Method Summary
static double abs(double a)
          abs returns the absolute value of a doublie.
static float abs(float a)
          abs returns the absolute value of a float.
static int abs(int a)
          abs returns the absolute value.
static long abs(long a)
          abs returns the absolute value.
static double acos(double a)
          acos calculates the arc cosine function.
static double asin(double a)
          asin calculates the arc sine function.
static double atan(double a)
          atan calculates the arc tangent function.
static double atan2(double a, double b)
          atan2 calculates the atan2 function, i.e., converts euclidic coordinates to the angle in polar coordinates.
static double cbrt(double a)
          cbrt calculates the cubic root.
static double ceil(double a)
          ceil calculates the ceiling function.
static double cos(double a)
          cos calculates the cosine function.
static double cosh(double x)
          Calculates the hyperbolic cosine of x.
static double exp(double a)
          exp calculates the exp function.
static double expm1(double x)
          expm1
static double floor(double a)
          floor calculates the floor function.
static double hypot(double x, double y)
          hypot
static double IEEEremainder(double f1, double f2)
          IEEEremainder calculates the remainder of 2 values as defined in IEEE 754 standard.
static double log(double a)
          log calculates the log function to base E.
static double log10(double a)
          log10 calculates the log function to base 10.
static double log1p(double x)
          log1p
static double max(double a, double b)
          max determines the larger of two values
static float max(float a, float b)
          max determines the larger of two values
static int max(int a, int b)
          max returns the maximum of a and b.
static long max(long a, long b)
          max returns the maximum of a and b.
static double min(double a, double b)
          min determines the smaller of two values
static float min(float a, float b)
          min determines the smaller of two values
static int min(int a, int b)
          min returns the minimum of a and b.
static long min(long a, long b)
          min returns the minimum of a and b.
static double pow(double a, double b)
          pow raises an argument to the power of another argument.
static double random()
          random returns a new double random number.
static double rint(double a)
          rint rounds a double to the closest integer value.
static long round(double a)
          round rounds a double to the closets long value.
static int round(float a)
          round rounds a float to the closest integer value.
static double signum(double d)
          signum
static float signum(float f)
          signum
static double sin(double a)
          sin calculates the sine function.
static double sinh(double x)
          Calculates the hyperbolic sine of x.
static double sqrt(double a)
          sqrt calculates the square root.
static double tan(double a)
          tan calculates the tangent function.
static double tanh(double x)
          Calculates the hyberbolic tangent of x.
static double toDegrees(double radians)
          toDegrees converst an angle given in radians (circle=2*PI) to degrees (circle=360).
static double toRadians(double degrees)
          toRadians converts an angle given in degrees (circle=360) to radians (circle=2*PI).
static double ulp(double d)
          ulp
static float ulp(float f)
          ulp
 
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
value of "E"

See Also:
Constant Field Values

PI

public static final double PI
value of "PI"

See Also:
Constant Field Values
Method Detail

sin

public static double sin(double a)
sin calculates the sine function.

Parameters:
a - argument to sine.
Returns:
the sine, NaN if a is NaN, +/-0 if a==+/-0.

cos

public static double cos(double a)
cos calculates the cosine function.

Parameters:
a - argument to cosine.
Returns:
the cosine, NaN if a is NaN.

tan

public static double tan(double a)
tan calculates the tangent function.

Parameters:
a - argument to tangent.
Returns:
the tangent, NaN if a is NaN or +/-Infinity, +/-0 if a==+/-0.

asin

public static double asin(double a)
asin calculates the arc sine function.

Parameters:
a - argument to arc sine.
Returns:
the arc sine, NaN if a is NaN or not within -1..+1, +/-0 if a==+/-0.

acos

public static double acos(double a)
acos calculates the arc cosine function.

Parameters:
a - argument to arc cosine.
Returns:
the arc cosine, NaN if a is Nan or not within -1..+1.

atan

public static double atan(double a)
atan calculates the arc tangent function.

Parameters:
a - argument to arc tangent.
Returns:
the arc tangent, NaN if a is NaN, +/-0 if a==+/-0.

toRadians

public static double toRadians(double degrees)
toRadians converts an angle given in degrees (circle=360) to radians (circle=2*PI).

Parameters:
degrees - the angle in degrees.
Returns:
the angle in radians.
Since:
1.2

toDegrees

public static double toDegrees(double radians)
toDegrees converst an angle given in radians (circle=2*PI) to degrees (circle=360).

Parameters:
radians - the angle in radians.
Returns:
the angle in degrees.

+ @since 1.2


exp

public static double exp(double a)
exp calculates the exp function.

Parameters:
a - argument to exp function.
Returns:
E^a, NaN if a is NaN, +Infinity if a==+Infinity, +0 if a==-Infinity.

log

public static double log(double a)
log calculates the log function to base E.

Parameters:
a - argument to log function.
Returns:
log(a), NaN if a is NaN or a<0, +Infinity if a==+Infinity, -Infinity if a==+/-0.

log10

public static double log10(double a)
log10 calculates the log function to base 10.

Parameters:
a - argument to log function.
Returns:
log10(a), NaN if a is NaN or a<0, +Infinity if a==+Infinity, -Infinity if a==+/-0.
Since:
1.5

sqrt

public static double sqrt(double a)
sqrt calculates the square root.

Parameters:
a - argument to square root.
Returns:
the square root, NaN if a is NaN, +Infinity if a==+Infinity, +/-0 if a==+/-0.

cbrt

public static double cbrt(double a)
cbrt calculates the cubic root.

Parameters:
a - argument to cubic root.
Returns:
the cubic root, negative iff a is negative, NaN if a is NaN, +/-Infinity if a==+/-Infinity, +/-0 if a==+/-0.
Since:
1.5

IEEEremainder

public static double IEEEremainder(double f1,
                                   double f2)
IEEEremainder calculates the remainder of 2 values as defined in IEEE 754 standard.

Parameters:
f1 - the first argument.
f2 - the second argument.
Returns:
the remainder; NaN if f1 or f2 is NaN, f1 is +Infinity, or f2 is +/-0; f1 if f2 is +/-Infinity

ceil

public static double ceil(double a)
ceil calculates the ceiling function.

Parameters:
a - argument to ceiling function.
Returns:
the ceiling of a, a if a is an integer, NaN, +/-Infintiy or +/-0, -0 if 0>a>-1.

floor

public static double floor(double a)
floor calculates the floor function.

Parameters:
a - argument to floor function.
Returns:
the floor of a, a if a is an integer, NaN, +/-Infinity or +/-0.

rint

public static double rint(double a)
rint rounds a double to the closest integer value.

Parameters:
a - argument to rint.
Returns:
the rounded value, a if a is an integer, NaN, +/-Infinity or +/-0.

atan2

public static double atan2(double a,
                           double b)
atan2 calculates the atan2 function, i.e., converts euclidic coordinates to the angle in polar coordinates.

Parameters:
a - the x coordinate.
b - the y coordinate.
Returns:
the angle in polar coordinates.

pow

public static double pow(double a,
                         double b)
pow raises an argument to the power of another argument.

Parameters:
a - the first argument.
b - the second argument.
Returns:
a^b.

round

public static int round(float a)
round rounds a float to the closest integer value.

Parameters:
a - a float value.
Returns:
the integer value closest to a, 0 if a is NaN.

round

public static long round(double a)
round rounds a double to the closets long value.

Parameters:
a - a double value.
Returns:
the long value closest to a, 0 if a is NaN.

random

public static double random()
random returns a new double random number.

This function uses a private instance of java.util.Random(). It is thread-safe.

Returns:
a double random number.

abs

public static int abs(int a)
abs returns the absolute value.

Parameters:
a - an integer.
Returns:
the absolute value of a, Integer.MIN_VALUE if a==Integer.MIN_VALUE.

abs

public static long abs(long a)
abs returns the absolute value.

Parameters:
a - a long.
Returns:
the absolute value of a, Long.MIN_VALUE if a==Long.MIN_VALUE.

abs

public static float abs(float a)
abs returns the absolute value of a float.

Parameters:
a - a float.
Returns:
a if a>=0, -a otherwise.

abs

public static double abs(double a)
abs returns the absolute value of a doublie.

Parameters:
a - a double.
Returns:
a if a>=0, -a otherwise.

max

public static int max(int a,
                      int b)
max returns the maximum of a and b.

Parameters:
a - first value
b - second value
Returns:
a if a>=b, b otherwise.

max

public static long max(long a,
                       long b)
max returns the maximum of a and b.

Parameters:
a - first value
b - second value
Returns:
a if a>=b, b otherwise.

max

public static float max(float a,
                        float b)
max determines the larger of two values

Parameters:
a - the first value
b - the second value
Returns:
a if a >= b, b if b >= a, NaN if a or b is NaN, +0 if a or b is +0 and a==b.

max

public static double max(double a,
                         double b)
max determines the larger of two values

Parameters:
a - the first value
b - the second value
Returns:
a if a >= b, b if b >= a, NaN if a or b is NaN, +0 if a or b is +0 and a==b.

min

public static int min(int a,
                      int b)
min returns the minimum of a and b.

Parameters:
a - first value
b - second value
Returns:
a if a<=b, b otherwise.

min

public static long min(long a,
                       long b)
min returns the minimum of a and b.

Parameters:
a - first value
b - second value
Returns:
a if a<=b, b otherwise.

min

public static float min(float a,
                        float b)
min determines the smaller of two values

Parameters:
a - the first value
b - the second value
Returns:
a if a <= b, b if b <= a, NaN if a or b is NaN, -0 if a or b is -0 and a==b.

min

public static double min(double a,
                         double b)
min determines the smaller of two values

Parameters:
a - the first value
b - the second value
Returns:
a if a <= b, b if b <= a, NaN if a or b is NaN, -0 if a or b is -0 and a==b.

ulp

public static double ulp(double d)
ulp

Parameters:
d -
Returns:
the size of an ulp of the argument
Since:
1.5

ulp

public static float ulp(float f)
ulp

Parameters:
f -
Returns:
the size of an ulp of the argument
Since:
1.5

signum

public static double signum(double d)
signum

Parameters:
d -
Returns:
the signum function of the argument
Since:
1.5

signum

public static float signum(float f)
signum

Parameters:
f -
Returns:
the signum function of the argument
Since:
1.5

sinh

public static double sinh(double x)
Calculates the hyperbolic sine of x.

Parameters:
x - the parameter to sinh
Returns:
the hyperbolic sine of x
Since:
1.5

cosh

public static double cosh(double x)
Calculates the hyperbolic cosine of x.

Parameters:
x - the parameter to cosh
Returns:
the hyperbolic cosine of x
Since:
1.5

tanh

public static double tanh(double x)
Calculates the hyberbolic tangent of x.

Parameters:
the - parameter to tanh
Returns:
the hyperbolic tangent of x
Since:
1.5

hypot

public static double hypot(double x,
                           double y)
hypot

Parameters:
x -
y -
Returns:
sqrt(x2 +y2) without intermediate overflow or underflow
Since:
1.5

expm1

public static double expm1(double x)
expm1

Parameters:
x -
Returns:
x - the exponent to raise e to in the computation of ex -1.
Since:
1.5

log1p

public static double log1p(double x)
log1p

Parameters:
x -
Returns:
x - a value
Since:
1.5

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.