We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Mathematical Library Methods
Used to carry out mathematical operations in programming.
Function Input Output Two inputs : Datatype of output 1) Math.min( a , b ) The datatypes can be can be ReturndataType min(dataType num1, byte, short, int, long, int, long, float or dataType num2) char, float, double double. Two inputs : Datatype of output 2) Math.max( a , b ) The datatypes can be can be ReturndataType max(dataType num1, byte, short, int, long, int, long, float or dataType num2) char, float, double. double. Two inputs : 3) Math.pow( a , b ) The datatypes can be double double pow(double a, double b) => ab byte, short, int, long, float, double. Function Input Output
4) Math.sqrt( a ) Should be a positive number – can be byte, double
double sqrt(double a) short, int, long, float or double. If negative number is the argument, it returns NaN. (Not a number)
5) Math.cbrt( a ) To find the cube root of a positive or double
double sqrt(double a) negative number. Cube root of a negative value is Can be byte, short, int, long, float or of negative sign double. 6) Math.abs( a ) Can be byte, short, int, long, float or Datatype of output can be DataType abs(DataType a) double. int, long, float or double.