Sunday, June 26, 2016

JAVA Math Class


The Math Class is JAVA contains many standard mathematical functions or methods

The class does not need to be imported and is called as shown:

Value = Math.Method_Name(Parameters);


Common Math methods:

absolute_Value=Math.abs(-33);

base_to_Exponent=Math.pow(base,exponent);

convert_Degrees_toRadians=Math.toRadians(60);

convert_Radians_toDegrees=Math.toDegrees(1.05);

cos_of_Angle_inRadians=Math.cos(0.52);

Eulers_number=Math.E + 20;

log_Base10=Math.log10(40000);

max_Value=Math.max(6,10,100);

minimum_Value=Math.min(-3,4);

random_Double_between0_and1=Math.random();

round_Down=Math.floor(4.2);

round_Nearest_WholeNumber=Math.round(6.5);

round_Up=Math.ceil(7.9);

sin_of_Angle_inRadians=Math.sin(1.75);

square_Root=Math.sqrt(44);

tan_of_Angle_inRadians=Math.tan(3.05);

Value_of_Pi=Math.PI *2;





No comments:

Post a Comment