Sunday, 11 June 2017

16.05.2017

Tuesday.

⟹JavaScript Math Object 

 

⟹Math.round()

➡Math.round(x) returns the value of x rounded down to its nearest integer

Math.round(4.7);    // returns 5 

Math.round(4.4);    // returns 4


⟹Math.pow()

➡Math.pow(x,y) returns the value of x to the power of y


 Math.pow(8, 2);      // returns 64 

 

⟹Math.sqrt()

  ➡Math.sqrt(x) returns the square root of x


 Math.sqrt(64);      // returns 8 


⟹Math.abs()

➡Math.abs(x) returns the absolute (positive) value of x:

 Math.abs(-4.7);     // returns 4.7 

 

⟹Math.ceil()

Math.ceil(4.4);     // returns 5  

 

⟹Math.floor()

 Math.floor(4.7);    // returns 4 

 

⟹Math.min() and Math.max()

➡Math.min() and Math.max() can be used to find the lowest or highest value in a list of arguments:

Math.min(0, 150, 30, 20, -8, -200);  // returns -200  


Math.max(0, 150, 30, 20, -8, -200);  // returns 150  

 

⟹Math.random()

Math.random() returns a random number between 0 (inclusive),  and 1 (exclusive):

 Math.random();     // returns a random number 


.............................................................








No comments:

Post a Comment

Machine Learning Annotation Introduction

Data annotation in Machine Learning is the process of annotating/ labeling data to categorize the dataset to identify by ML models. It can b...