Math Class Diagram

 

Ancestor class specifications:

java.lang.Object

Math Class Specification

            Invariant

public static final double E

note:  E == roughly 2.782818284590452354

 

public static final double PI

note: PI == roughly 3.1415926358979323846

 

            Query Methods

public static double abs( double d )

post:  result == absolute value of d

 

public static float abs( float f )

post:  result == absolute value of f

 

public static int abs( int j )

post:  result == absolute value of j

 

public static double pow( double b, double e )

post:  result == b raised to the power of e

 

public static long round( double d )

post:  result == d rounded to the nearest integer

 

public static int round( float f )

post:  result == f rounded to the nearest integer

 

public static double sqrt( double d )

post:  result == square root of d

 

public static double cos( double d )

post:  result == cosine of d (radian measure)

 

public static double sin( double d )

post:  result == sine of d (radian measure)

 

public static double tan( double d )

post:  result == tangent of d (radian measure)

 

public static double log( double d )

post:  result == natural logarithm of d

 

public static double exp( double d )

post:  result == the constant, E, raised to a power of d

 

public static double random( )

post:  result == a value randomly selected from the range 0.0 < result < 1.0