Theme Layout

Boxed or Wide or Framed

Wide

Theme Translation

Display Featured Slider

Featured Slider Styles

Display Grid Slider

yes

Grid Slider Styles

Display Trending Posts

Display Author Bio

Display Instagram Footer

off

Dark or Light Style

Light

Blog Archive

Powered by Blogger.

Tuesday, February 14, 2017

[JavaScript] Math Object


# JavaScript Math Object


● Math.round()

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

● Math.pow()

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

● Math.sqrt()

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

● Math.abs()

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

● Math.ceil()

 Math.ceil(x) returns the value of x rounded up to its nearest integer.

● Math.floor()

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

● Math.sin()

 Math.sin(x) returns the sine ( -1 <= value <=1 ) of the angle x (radians).
If I want to use degrees instead of radians, I have to convert degrees to radians.
<Angle in radians = Angle in degrees * PI/180>

● Math.cos()

 Math.cos(x) returns the cosine of the angle x (radians).

● 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.random()

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

● Math.Properties ( Constants )

 JavaScript provides 8 mathematical constants that can be accessed with the Math Object.

● Math.Constructor

 Unlike other global objects, the Math Object has no constructor. Methods and properties are static. All methods and properties can be used without creating a Math object first.

http://www.w3schools.com/js/js_math.asp




QuickEdit
Unknown
0 Comments
Share This Post :

You Might Also Like

No comments:

Post a Comment

Follow @SunriseSunsetBlog