StrictMath class Methods in Java Part -IV

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.nextUp(double): This method returns the floating-point value adjacent to d in the direction of positive infinity.


StrictMath.nextUp(float): This method returns the floating-point value adjacent to f in the direction of positive infinity.


StrictMath.pow():  This method returns the value of the first argument raised to the power of the second argument.


StrictMath.random(): This method returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0


StrictMath.rint(): This method returns the double value that is closest in value to the argument and is equal to a mathematical integer.


StrictMath.round(double): This method returns the closest long to the argument, with ties rounding to positive infinity.


StrictMath.round(float): This method returns the closest int to the argument, with ties rounding to positive infinity.


StrictMath.scalb(double, int):  This method returns d ×2^scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set.


StrictMath.scalb(float, int): This method returns f ×2^scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set.


StrictMath.signum(double): This method returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero.


StrictMath.signum(float): This method returns the signum function of the argument; zero if the argument is zero, 1.0f if the argument is greater than zero, -1.0f if the argument is less than zero.


StrictMath.sin(): This method returns the trigonometric sine of an angle.


StrictMath.sinh():  This method returns the hyperbolic sine of a double value. The hyperbolic sine of x is defined to be (e^x - e^-x)/2 where e is Euler's number.


StrictMath.sqrt(): This method returns the correctly rounded positive square root of a double value.


StrictMath.subtractExact(int, int): This method returns the difference of the arguments, throwing an exception if the result overflows an int.


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


StrictMath.tan(): This method returns the trigonometric tangent of an angle.


StrictMath.tanh(): his method returns the hyperbolic tangent of a double value.The hyperbolic tangent of x is defined to be(ex - e-x)/(ex + e-x),in other words, sinh(x)/cosh(x).


StrictMath.toDegrees(): This method converts an angle measured in radians to an approximately equivalent angle measured in degrees.


StrictMath.toIntExact(): This method returns the value of the long argument, throwing an exception if the value overflows an int.


StrictMath.toRadians(): This method converts an angle measured in degrees to an approximately equivalent angle measured in radians.


StrictMath.ulp(double): This method returns the size of an ulp of the argument.


StrictMath.ulp(float): This method returns the size of an ulp of the argument. 


Some more Methods of StrictMath class Part -I


Some more Methods of StrictMath class Part -II


Some more Methods of StrictMath class Part -III


No comments:

Post a Comment