StrictMath class Methods in Java Part -I

java.lang.StrictMath

The class StrictMath contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.


Some of the Methods of  StrictMath class.


StrictMath.abs(double): This method returns the absolute value of a double value.


StrictMath.absExact(int): This method returns the mathematical absolute value of an int value if it is exactly representable as an int, throwing ArithmeticException if the result overflows the positive int range.


StrictMath.absExact(long): This method returns the mathematical absolute value of a long value if it is exactly representable as a long, throwing ArithmeticException if the result overflows the positive long-range.


StrictMath.abs(float): This method returns the absolute value of a float value.


StrictMath.abs(int): This method returns the absolute value of an int value.


StrictMath.abs(long): This method returns the absolute value of a long value.


StrictMath.acos():  This method returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.


StrictMath.addExact(int, int): This method returns the sum of its arguments, throwing an exception if the result overflows an int.


StrictMath.addExact(long, long): This method returns the sum of its arguments, throwing an exception if the result overflows a long.


StrictMath.asin(): This method returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2.


StrictMath.atan(): This method returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2.


StrictMath.atan2():  This method returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).


StrictMath.cbrt(): This method returns the cube root of a double value.


StrictMath.ceil(): This method returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer.


StrictMath.copySign(double, double): his method returns the first floating-point argument with the sign of the second floating-point argument.


StrictMath.copySign(float, float): This method returns the first floating-point argument with the sign of the second floating-point argument.


StrictMath.cos(): This method returns the trigonometric cosine of an angle.


StrictMath.cosh(): This method returns the hyperbolic cosine of a double value. 


StrictMath.decrementExact(int): This method returns the argument decremented by one, throwing an exception if the result overflows an int.


StrictMath.decrementExact(long):  This method returns the argument decremented by one, throwing an exception if the result overflows a long. 


Some more Methods of StrictMath class Part -II


Some more Methods of StrictMath class Part -III


Some more Methods of StrictMath class Part -IV




No comments:

Post a Comment