An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
Important Math methods
1. Math.min( )
The Math.min( ) method is used to find the lowest value in a list of arguments. Have a look at the example below:
2. Math.max( )
The Math.max( ) method is used to find the highest value in a list of arguments. Have a look at the example below:
3. Math.round( )
The Math.round(x) method returns the value of a number x rounded to its nearest integer:
4. Math.sqrt( )
The Math.sqrt(x) is used to return the square root of a number x. Have a look at the example below:
5. Math.pow( )
The Math.pow(x, y) returns the value of x to the power of y. Lets have a look at the below example:
6. Math.floor( )
The Math.floor(x) returns the value of x rounded down to its nearest integer:
7. Math.random( )
The Math.random() returns a random number between 0 and 1. Its often used to extract random elements from an array.
8. Math.ceil( )
The Math.ceil(x) returns the value of x rounded up to its nearest integer:
Original Link: https://dev.to/pritomdbhaskar/important-math-methods-1od0
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To