JAVA.
Do you wanted to know what is mathematical function? to know that, read the following carefully and completely to understand.
MATHEMATICAL FUNCTIONS.
Other than addition, subtraction, multication and division, mathematics subject hold lots of operations like power, squaring, trigonometric functions etc... known as mathematical functions.
Java provide access to such mathematical functions.
They are all defined in the class called java.math.lang package.
All of this function are static function, that is it can be assessed in the class name, there is no need to create an object for this.
The following are some of the mathematical functions of java.
| Function | Description |
sin(x); cos(x); tan(x); asin(x); acos(x); atan(x); sinh(x); cosh(x); tanh(x); exp(x); pow(x,y); sqrt(x); abs(x); ceil(x); floor(x); | sine value of x. cosine value of x. tan value of x. inverse sine value of x. inverse cosine value of x. inverse tan value of x. hyperbolic sine value of x. hyperbolic cosine value of x. hyperbolic tan value of x. return value of e to the power of x. return value of x to the power of y. return value of squared of x. compute absolute value of x. rounds the value of x to nearest greatest number. rounds the value of x to nearest lowest number. |
sin(x);
This function gives the sine value of given argument.
syntax:
sin(argument);
example:
sin(90); returns the value 1.0.
sin(30); returns the value 0.5.
cos(x);
This function gives the cosine value of given argument.
syntax:
cos(argument);
example:
cos(0); returns the value 1.0.
cos(60); returns the value 0.5.
tan(x);
This function gives the tangent value of given argument.
syntax:
cos(argument);
example:
cos(60); returns the value 2.
cos(90); returns the value 0.
asin(x), acos(x), atan(x);
This gives the inverted value of the given argument.
sinh(x), cosh(x), tanh(x);
This functions gives the hyperbolic valve of the given argument.
exp(x);
This is is an exponent function that is e rised to the power of x. it gives the exponent value ti the argument.
pow(x,y);
This is a power function.this functions takes two argument. The first argument is base and the second argument is power raised to the base.
syntax:
pow(arg-1,arg-2);
example:
pow(2,4); returns the valve 16.
sqrt(x);
This is a function used to find square root. It gives the squared value of the argument.
syntax:
sqrt(argument);
example:
sqrt(8); returns the value 64.
abs(x);
This function compute absolute argument of floating point argument.
syntax:
abs(argument);
example:
abs(-10) return the value 10
ceil(x);
This function ceil() calcuate the nearest integer greater than the given argument.
syntax:
ceil(argument);
example:
ceil(4.7); returns the value 5.
ceil(55.4); returns the value 56.
floor(x);
This function floor() calcuate the nearest integer lesser than the given argument.
syntax:
floor(argument);
example:
floor(4.7); returns the value 4.
floor(55.4); returns the value 55.
Comments
Post a Comment