img
Method
Description
static double copySign(double arg,
Returns arg with same sign as that of signarg.
double signarg)
(Added by Java SE 6.)
static float copySign(float arg,
Returns arg with same sign as that of signarg.
float signarg)
(Added by Java SE 6.)
static int getExponent(double arg)
Returns the base-2 exponent used by the binar y
representation of arg. (Added by Java SE 6.)
static int getExponent(float arg)
Returns the base-2 exponent used by the binar y
representation of arg. (Added by Java SE 6.)
Returns the remainder of dividend / divisor.
static double
IEEEremainder(double dividend,
double divisor)
static hypot(double side1, double side2)
Returns the length of the hypotenuse of a right
triangle given the length of the two opposing sides.
static double random( )
Returns a pseudorandom number between 0 and 1.
static float signum(double arg)
Determines the sign of a value. It returns 0 if arg is 0,
1 if arg is greater than 0, and ­1 if arg is less than 0.
static float signum(float arg)
Determines the sign of a value. It returns 0 if arg is 0,
1 if arg is greater than 0, and ­1 if arg is less than 0.
static double toDegrees(double angle)
Conver ts radians to degrees. The angle passed to
angle must be specified in radians. The result in
degrees is returned.
static double toRadians(double angle)
Conver ts degrees to radians. The angle passed to
angle must be specified in degrees. The result in
radians is returned.
The following program demonstrates toRadians( ) and toDegrees( ):
// Demonstrate toDegrees() and toRadians().
class Angles {
public static void main(String args[]) {
double theta = 120.0;
System.out.println(theta + " degrees is " +
Math.toRadians(theta) + " radians.");
theta = 1.312;
System.out.println(theta + " radians is " +
Math.toDegrees(theta) + " degrees.");
}
}
The output is shown here:
120.0 degrees is 2.0943951023931953 radians.
1.312 radians is 75.17206272116401 degrees.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home