Tuesday 12 March 2013

java.lang Math


java.lang
Math

Declaration
public final class Math
java.lang.Object
|
+--java.lang.Math
Description
The class Math contains methods for performing basic numeric operations.


Member Summary
Fields
static double E
static double PI
Methods
static double abs(double a)
static float abs(float a)
static int abs(int a)
static long abs(long a)
static double ceil(double a)
static double cos(double a)
static double floor(double a)
static double max(double a, double b)
static float max(float a, float b)
static int max(int a, int b)
static long max(long a, long b)
static double min(double a, double b)
static float min(float a, float b)
static int min(int a, int b)
static long min(long a, long b)
static double sin(double a)
static double sqrt(double a)
static double tan(double a)
static double toDegrees(double angrad)
static double toRadians(double angdeg)


Fields
E
Declaration:
public static final double E
Description:
The double value that is closer than any other to e, the base of the natural logarithms.
Since: CLDC 1.1
PI
Declaration:
public static final double PI
Description:
The double value that is closer than any other to pi, the ratio of the circumference of a circle to its
diameter.
Since: CLDC 1.1
Methods
sin(double)
Declaration:
public static double sin(double a)
Description:
Returns the trigonometric sine of an angle. Special cases:
• If the argument is NaN or an infinity, then the result is NaN.
• If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then
the result is negative zero.
Parameters:
a - an angle, in radians.
Returns: the sine of the argument.
Since: CLDC 1.1
cos(double)
Declaration:
public static double cos(double a)

tan(double)

Description:
Returns the trigonometric cosine of an angle. Special case:
• If the argument is NaN or an infinity, then the result is NaN.
Parameters:
a - an angle, in radians.
Returns: the cosine of the argument.
Since: CLDC 1.1
tan(double)
Declaration:
public static double tan(double a)
Description:
Returns the trigonometric tangent of an angle. Special cases:
• If the argument is NaN or an infinity, then the result is NaN.
• If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then
the result is negative zero
Parameters:
a - an angle, in radians.
Returns: the tangent of the argument.
Since: CLDC 1.1
toRadians(double)
Declaration:
public static double toRadians(double angdeg)
Description:
Converts an angle measured in degrees to the equivalent angle measured in radians.
Parameters:
angdeg - an angle, in degrees
Returns: the measurement of the angle angdeg in radians.
Since: CLDC 1.1
toDegrees(double)
Declaration:
public static double toDegrees(double angrad)
Description:
Converts an angle measured in radians to the equivalent angle measured in degrees.
Parameters:
angrad - an angle, in radians
Returns: the measurement of the angle angrad in degrees.
Since: CLDC 1.1


sqrt(double)
Declaration:
public static double sqrt(double a)
Description:
Returns the correctly rounded positive square root of a double value. Special cases:
• If the argument is NaN or less than zero, then the result is NaN.
• If the argument is positive infinity, then the result is positive infinity.
• If the argument is positive zero or negative zero, then the result is the same as the argument.
Parameters:
a - a double value.
Returns: the positive square root of a. If the argument is NaN or less than zero, the result is NaN.
Since: CLDC 1.1
ceil(double)
Declaration:
public static double ceil(double a)
Description:
Returns the smallest (closest to negative infinity) double value that is not less than the argument and is
equal to a mathematical integer. Special cases:
• If the argument value is already equal to a mathematical integer, then the result is the same as the
argument.
• If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the
argument.
• If the argument value is less than zero but greater than -1.0, then the result is negative zero.
Note that the value of Math.ceil(x) is exactly the value of -Math.floor(-x).
Parameters:
a - a double value.
Returns: the smallest (closest to negative infinity) double value that is not less than the argument and is
equal to a mathematical integer.
Since: CLDC 1.1

floor(double)
Declaration:
public static double floor(double a)
Description:
Returns the largest (closest to positive infinity) double value that is not greater than the argument and is
equal to a mathematical integer. Special cases:
• If the argument value is already equal to a mathematical integer, then the result is the same as the
argument.
• If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the
argument.





No comments:

Post a Comment