Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 22, 2021 08:11 pm GMT

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:
Image description

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:
Image description

3. Math.round( )
The Math.round(x) method returns the value of a number x rounded to its nearest integer:
Image description

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:
Image description

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:
Image description

6. Math.floor( )
The Math.floor(x) returns the value of x rounded down to its nearest integer:
Image description

7. Math.random( )
The Math.random() returns a random number between 0 and 1. Its often used to extract random elements from an array.
Image description

8. Math.ceil( )
The Math.ceil(x) returns the value of x rounded up to its nearest integer:
Image description


Original Link: https://dev.to/pritomdbhaskar/important-math-methods-1od0

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To